var eworkspacePlugin=function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]2&&(s.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return _(e,s,r,o,null)}function _(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++s:o,__i:-1,__u:0};return null==o&&null!=a.vnode&&a.vnode(i),i}function M(){return{current:null}}function S(e){return e.children}function E(e,t){this.props=e,this.context=t}function z(e,t){if(null==t)return e.__?z(e.__,e.__i+1):null;for(var n;tt&&l.sort(u));O.__r=0}function T(e,t,n,r,o,i,a,s,l,c,d){var u,p,h,f,m,v=r&&r.__k||y,x=t.length;for(n.__d=l,function(e,t,n){var r,o,i,a,s,l=t.length,c=n.length,d=c,u=0;for(e.__k=[],r=0;r0?_(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=P(o,n,a,d),o.__i=s,i=null,-1!==s&&(d--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&u--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s==a-1?u=s-a:s==a+1?u++:s>a?d>l-a?u+=s-a:u--:s(null==l||131072&l.__u?0:1))for(;a>=0||s=0){if((l=t[a])&&!(131072&l.__u)&&o==l.key&&i===l.type)return a;a--}if(s2&&(l.children=arguments.length>3?i.call(arguments,2):n),_(e.type,l,r||e.key,o||e.ref,null)}function V(e,t){var n={__c:t="__cC"+m++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,L(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}i=y.slice,a={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},s=0,E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=x({},this.state),"function"==typeof e&&(e=e(x({},n),this.props)),e&&x(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),L(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),L(this))},E.prototype.render=S,l=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,p=0,h=R(!1),f=R(!0),m=0;var U,Z=0;function G(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?s=t[l]:c[l]=t[l];var d={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Z,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(l in s)void 0===c[l]&&(c[l]=s[l]);return a.vnode&&a.vnode(d),d}null!=(U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0)&&U.__PREACT_DEVTOOLS__&&U.__PREACT_DEVTOOLS__.attachPreact("10.22.1",a,{Fragment:S,Component:E});var X={};function Y(e){return e.type===S?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var J=[],Q=[];function ee(){return J.length>0?J[J.length-1]:null}var te=!0;function ne(e){return"function"==typeof e.type&&e.type!=S}function re(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+Y(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":te&&console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons."),te=!1,e+"\n"}),"")}var oe="function"==typeof WeakMap;function ie(e){var t=[];return e.__k?(e.__k.forEach((function(e){e&&"function"==typeof e.type?t.push.apply(t,ie(e)):e&&"string"==typeof e.type&&t.push(e.type)})),t):t}function ae(e){return e?"function"==typeof e.type?null===e.__?null!==e.__e&&null!==e.__e.parentNode?e.__e.parentNode.localName:"":ae(e.__):e.type:""}var se=E.prototype.setState;function le(e){return"table"===e||"tfoot"===e||"tbody"===e||"thead"===e||"td"===e||"tr"===e||"th"===e}E.prototype.setState=function(e,t){return null==this.__v&&null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+re(ee())),se.call(this,e,t)};var ce=/^(address|article|aside|blockquote|details|div|dl|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|main|menu|nav|ol|p|pre|search|section|table|ul)$/,de=E.prototype.forceUpdate;function ue(e){var t=e.props,n=Y(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var a=t.children;return"<"+n+r+(a&&a.length?">..":" />")}function pe(e){this.message=e}E.prototype.forceUpdate=function(e){return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+re(ee())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+re(this.__v)),de.call(this,e)},function(){!function(){var e=a.__b,t=a.diffed,n=a.__,r=a.vnode,o=a.__r;a.diffed=function(e){ne(e)&&Q.pop(),J.pop(),t&&t(e)},a.__b=function(t){ne(t)&&J.push(t),e&&e(t)},a.__=function(e,t){Q=[],n&&n(e,t)},a.vnode=function(e){e.__o=Q.length>0?Q[Q.length-1]:null,r&&r(e)},a.__r=function(e){ne(e)&&Q.push(e),o&&o(e)}}();var e=!1,t=a.__b,n=a.diffed,r=a.vnode,o=a.__r,i=a.__e,s=a.__,l=a.__h,c=oe?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,d=[];a.__e=function(e,t,n,r){if(t&&t.__c&&"function"==typeof e.then){var o=e;e=new Error("Missing Suspense. The throwing component was: "+Y(t));for(var a=t;a;a=a.__)if(a.__c&&a.__c.__c){e=o;break}if(e instanceof Error)throw e}try{(r=r||{}).componentStack=re(t),i(e,t,n,r),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},a.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=Y(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}s&&s(e,t)},a.__b=function(n){var r=n.type;if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+ue(n)+"\n\n"+re(n));if(null!=r&&"object"==typeof r){if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+Y(n)+" = "+ue(r)+";\n let vnode = ;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+re(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if(void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+ue(n)+"\n\n"+re(n));if("string"==typeof n.type)for(var o in n.props)if("o"===o[0]&&"n"===o[1]&&"function"!=typeof n.props[o]&&null!=n.props[o])throw new Error("Component's \""+o+'" property should be a function, but got ['+typeof n.props[o]+"] instead\n"+ue(n)+"\n\n"+re(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&c&&!c.lazyPropTypes.has(n.type)){var i="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var a=n.type();c.lazyPropTypes.set(n.type,!0),console.warn(i+"Component wrapped in lazy() is "+Y(a))}catch(e){console.warn(i+"We will log the wrapped component's name once it is loaded.")}}var s=n.props;n.type.__f&&delete(s=function(e,t){for(var n in t)e[n]=t[n];return e}({},s)).ref,function(e,t,n,r,o){Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}i&&!(i.message in X)&&(X[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,s,0,Y(n),(function(){return re(n)}))}t&&t(n)};var u,p=0;a.__r=function(t){o&&o(t),e=!0;var n=t.__c;if(n===u?p++:p=1,p>=25)throw new Error("Too many re-renders. This is limited to prevent an infinite loop which may lock up your browser. The component causing this is: "+Y(t));u=n},a.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");l&&l(t,n,r)};var h=function(e,t){return{get:function(){var n="get"+e+t;d&&d.indexOf(n)<0&&(d.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;d&&d.indexOf(n)<0&&(d.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},f={nodeName:h("nodeName","use vnode.type"),attributes:h("attributes","use vnode.props"),children:h("children","use vnode.props.children")},m=Object.create({},f);a.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var o in t){var i=t[o];"__source"===o?e.__source=i:"__self"===o?e.__self=i:n[o]=i}}e.__proto__=m,r&&r(e)},a.diffed=function(t){var r,o=t.type,i=t.__;if(t.__k&&t.__k.forEach((function(e){if("object"==typeof e&&e&&void 0===e.type){var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+re(t))}})),t.__c===u&&(p=0),"string"==typeof o&&(le(o)||"p"===o||"a"===o||"button"===o)){var a=ae(i);if(""!==a)"table"===o&&"td"!==a&&le(a)?(console.log(a,i.__e),console.error("Improper nesting of table. Your should not have a table-node parent."+ue(t)+"\n\n"+re(t))):"thead"!==o&&"tfoot"!==o&&"tbody"!==o||"table"===a?"tr"===o&&"thead"!==a&&"tfoot"!==a&&"tbody"!==a?console.error("Improper nesting of table. Your should have a parent."+ue(t)+"\n\n"+re(t)):"td"===o&&"tr"!==a?console.error("Improper nesting of table. Your parent."+ue(t)+"\n\n"+re(t)):"th"===o&&"tr"!==a&&console.error("Improper nesting of table. Your ."+ue(t)+"\n\n"+re(t)):console.error("Improper nesting of table. Your should have a
should have a
should have a
parent."+ue(t)+"\n\n"+re(t));else if("p"===o){var s=ie(t).filter((function(e){return ce.test(e)}));s.length&&console.error("Improper nesting of paragraph. Your

should not have "+s.join(", ")+"as child-elements."+ue(t)+"\n\n"+re(t))}else"a"!==o&&"button"!==o||-1!==ie(t).indexOf(o)&&console.error("Improper nesting of interactive content. Your <"+o+"> should not have other "+("a"===o?"anchor":"button")+" tags as child-elements."+ue(t)+"\n\n"+re(t))}if(e=!1,n&&n(t),null!=t.__k)for(var l=[],c=0;c>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function fe(e){this.message=e}function me(e,t){if("string"!=typeof e)throw new fe("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(he(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return he(t)}}(e.split(".")[n]))}catch(e){throw new fe("Invalid token specified: "+e.message)}}fe.prototype=new Error,fe.prototype.name="InvalidTokenError";var ge,ye,ve,be,xe=0,we=[],ke=a,_e=ke.__b,Me=ke.__r,Se=ke.diffed,Ee=ke.__c,ze=ke.unmount,Ce=ke.__;function Le(e,t){ke.__h&&ke.__h(ye,e,xe||t),xe=0;var n=ye.__H||(ye.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Oe(e){return xe=1,Te(Ue,e)}function Te(e,t,n){var r=Le(ge++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ue(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ye,!ye.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};ye.u=!0;var i=ye.shouldComponentUpdate,a=ye.componentWillUpdate;ye.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}a&&a.call(this,e,t,n)},ye.shouldComponentUpdate=o}return r.__N||r.__}function Ae(e,t){var n=Le(ge++,3);!ke.__s&&Ve(n.__H,t)&&(n.__=e,n.i=t,ye.__H.__h.push(n))}function De(e,t){var n=Le(ge++,4);!ke.__s&&Ve(n.__H,t)&&(n.__=e,n.i=t,ye.__h.push(n))}function Pe(e){return xe=5,Ne((function(){return{current:e}}),[])}function Ie(e,t,n){xe=6,De((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function Ne(e,t){var n=Le(ge++,7);return Ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Re(e,t){return xe=8,Ne((function(){return e}),t)}function Be(e){var t=ye.context[e.__c],n=Le(ge++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ye)),t.props.value):e.__}function je(e,t){ke.useDebugValue&&ke.useDebugValue(t?t(e):e)}function $e(){var e=Le(ge++,11);if(!e.__){for(var t=ye.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ke(){for(var e;e=we.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(He),e.__H.__h.forEach(We),e.__H.__h=[]}catch(t){e.__H.__h=[],ke.__e(t,e.__v)}}ke.__b=function(e){ye=null,_e&&_e(e)},ke.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},ke.__r=function(e){Me&&Me(e),ge=0;var t=(ye=e.__c).__H;t&&(ve===ye?(t.__h=[],ye.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(He),t.__h.forEach(We),t.__h=[],ge=0)),ve=ye},ke.diffed=function(e){Se&&Se(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==we.push(t)&&be===ke.requestAnimationFrame||((be=ke.requestAnimationFrame)||Fe)(Ke)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),ve=ye=null},ke.__c=function(e,t){t.some((function(e){try{e.__h.forEach(He),e.__h=e.__h.filter((function(e){return!e.__||We(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ke.__e(n,e.__v)}})),Ee&&Ee(e,t)},ke.unmount=function(e){ze&&ze(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{He(e)}catch(e){t=e}})),n.__H=void 0,t&&ke.__e(t,n.__v))};var qe="function"==typeof requestAnimationFrame;function Fe(e){var t,n=function(){clearTimeout(r),qe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);qe&&(t=requestAnimationFrame(n))}function He(e){var t=ye,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ye=t}function We(e){var t=ye;e.__c=e.__(),ye=t}function Ve(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ue(e,t){return"function"==typeof t?t(e):t}function Ze(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}var Ge={exports:{}};function Xe(e,t){for(var n in t)e[n]=t[n];return e}function Ye(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Je(e,t){this.props=e,this.context=t}function Qe(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Ye(this.props,e)}function r(t){return this.shouldComponentUpdate=n,k(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Je.prototype=new E).isPureReactComponent=!0,Je.prototype.shouldComponentUpdate=function(e,t){return Ye(this.props,e)||Ye(this.state,t)};var et=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),et&&et(e)};var tt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function nt(e){function t(t){var n=Xe({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=tt,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var rt=function(e,t){return null==e?null:D(D(e).map(t))},ot={map:rt,forEach:rt,count:function(e){return e?D(e).length:0},only:function(e){var t=D(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:D},it=a.__e;a.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);it(e,t,n,r)};var at=a.unmount;function st(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Xe({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return st(e,t,n)}))),e}function lt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return lt(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ct(){this.__u=0,this.t=null,this.__b=null}function dt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ut(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return k(n,o)}return o.displayName="Lazy",o.__f=!0,o}function pt(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),at&&at(e)},(ct.prototype=new E).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=dt(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=lt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ct.prototype.componentWillUnmount=function(){this.t=[]},ct.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=st(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&k(S,null,e.fallback);return o&&(o.__u&=-33),[k(S,null,t.__a?null:e.children),o]};var ht=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),F(k(ft,{context:t.context},e.__v),t.l)}function gt(e,t){var n=k(mt,{__v:e,i:t});return n.containerInfo=t,n}(pt.prototype=new E).__a=function(e){var t=this,n=dt(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),ht(t,e,r)):o()};n?n(i):i()}},pt.prototype.render=function(e){this.u=null,this.o=new Map;var t=D(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},pt.prototype.componentDidUpdate=pt.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){ht(e,n,t)}))};var yt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,vt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,bt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xt=/[A-Z0-9]/g,wt="undefined"!=typeof document,kt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function _t(e,t,n){return null==t.__k&&(t.textContent=""),F(e,t),"function"==typeof n&&n(),e?e.__c:null}function Mt(e,t,n){return H(e,t),"function"==typeof n&&n(),e?e.__c:null}E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var St=a.event;function Et(){}function zt(){return this.cancelBubble}function Ct(){return this.defaultPrevented}a.event=function(e){return St&&(e=St(e)),e.persist=Et,e.isPropagationStopped=zt,e.isDefaultPrevented=Ct,e.nativeEvent=e};var Lt,Ot={enumerable:!1,configurable:!0,get:function(){return this.class}},Tt=a.vnode;a.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||wt&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||kt(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":bt.test(o)?o=a:-1===n.indexOf("-")&&vt.test(o)?o=o.replace(xt,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=D(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=D(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",Ot)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=yt,Tt&&Tt(e)};var At=a.__r;a.__r=function(e){At&&At(e),Lt=e.__c};var Dt=a.diffed;a.diffed=function(e){Dt&&Dt(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),Lt=null};var Pt={ReactCurrentDispatcher:{current:{readContext:function(e){return Lt.__n[e.__c].props.value},useCallback:Re,useContext:Be,useDebugValue:je,useDeferredValue:Vt,useEffect:Ae,useId:$e,useImperativeHandle:Ie,useInsertionEffect:Zt,useLayoutEffect:De,useMemo:Ne,useReducer:Te,useRef:Pe,useState:Oe,useSyncExternalStore:Xt,useTransition:Ut}}};function It(e){return k.bind(null,e)}function Nt(e){return!!e&&e.$$typeof===yt}function Rt(e){return Nt(e)&&e.type===S}function Bt(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function jt(e){return Nt(e)?W.apply(null,arguments):e}function $t(e){return!!e.__k&&(F(null,e),!0)}function Kt(e){return e&&(e.base||1===e.nodeType&&e)||null}var qt=function(e,t){return e(t)},Ft=function(e,t){return e(t)},Ht=S;function Wt(e){e()}function Vt(e){return e}function Ut(){return[!1,Wt]}var Zt=De,Gt=Nt;function Xt(e,t){var n=t(),r=Oe({h:{__:n,v:t}}),o=r[0].h,i=r[1];return De((function(){o.__=n,o.v=t,Yt(o)&&i({h:o})}),[e,n,t]),Ae((function(){return Yt(o)&&i({h:o}),e((function(){Yt(o)&&i({h:o})}))}),[e]),n}function Yt(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var Jt={useState:Oe,useId:$e,useReducer:Te,useEffect:Ae,useLayoutEffect:De,useInsertionEffect:Zt,useTransition:Ut,useDeferredValue:Vt,useSyncExternalStore:Xt,startTransition:Wt,useRef:Pe,useImperativeHandle:Ie,useMemo:Ne,useCallback:Re,useContext:Be,useDebugValue:je,version:"17.0.2",Children:ot,render:_t,hydrate:Mt,unmountComponentAtNode:$t,createPortal:gt,createElement:k,createContext:V,createFactory:It,cloneElement:jt,createRef:M,Fragment:S,isValidElement:Nt,isElement:Gt,isFragment:Rt,isMemo:Bt,findDOMNode:Kt,Component:E,PureComponent:Je,memo:Qe,forwardRef:nt,flushSync:Ft,unstable_batchedUpdates:qt,StrictMode:Ht,Suspense:ct,SuspenseList:pt,lazy:ut,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Pt},Qt=Object.freeze({__proto__:null,Children:ot,PureComponent:Je,StrictMode:Ht,Suspense:ct,SuspenseList:pt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Pt,cloneElement:jt,createFactory:It,createPortal:gt,default:Jt,findDOMNode:Kt,flushSync:Ft,forwardRef:nt,hydrate:Mt,isElement:Gt,isFragment:Rt,isMemo:Bt,isValidElement:Nt,lazy:ut,memo:Qe,render:_t,startTransition:Wt,unmountComponentAtNode:$t,unstable_batchedUpdates:qt,useDeferredValue:Vt,useInsertionEffect:Zt,useSyncExternalStore:Xt,useTransition:Ut,version:"17.0.2",Component:E,Fragment:S,createContext:V,createElement:k,createRef:M,useCallback:Re,useContext:Be,useDebugValue:je,useEffect:Ae,useErrorBoundary:function(e){var t=Le(ge++,10),n=Oe();return t.__=e,ye.componentDidCatch||(ye.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:$e,useImperativeHandle:Ie,useLayoutEffect:De,useMemo:Ne,useReducer:Te,useRef:Pe,useState:Oe}),en=Ze(Qt);self,Ge.exports=function(e){return function(){var t={207:function(e,t,n){n.r(t),n.d(t,{default:function(){return xp}});var r=n(698),o=n.n(r);function i(e){this.content=e}i.prototype={constructor:i,find:function(e){for(var t=0;t>1}},i.from=function(e){if(e instanceof i)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new i(t)};var a=i;function s(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var l=s(o.content,i.content,n+1);if(null!=l)return l}n+=o.nodeSize}else n+=o.nodeSize}}function l(e,t,n,r){for(var o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=e.child(--o),s=t.child(--i),c=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var d=0,u=Math.min(a.text.length,s.text.length);de&&!1!==n(s,r+a,o,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,e-c),Math.min(s.content.size,t-c),n,r+c)}a=l}},c.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},c.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf&&r?(o+=r,i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o},c.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);oe)for(var o=0,i=0;ie&&((it)&&(a=a.isText?a.cut(Math.max(0,e-i),Math.min(a.text.length,t-i)):a.cut(Math.max(0,e-i-1),Math.min(a.content.size,t-i-1))),n.push(a),r+=a.nodeSize),i=s}return new c(n,r)},c.prototype.cutByIndex=function(e,t){return e==t?c.empty:0==e&&t==this.content.length?this:new c(this.content.slice(e,t))},c.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new c(r,o)},c.prototype.addToStart=function(e){return new c([e].concat(this.content),this.size+e.nodeSize)},c.prototype.addToEnd=function(e){return new c(this.content.concat(e),this.size+e.nodeSize)},c.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;tthis.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?p(n+1,o):p(n,r);r=o}},c.prototype.toString=function(){return"<"+this.toStringInner()+">"},c.prototype.toStringInner=function(){return this.content.join(", ")},c.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},c.fromJSON=function(e,t){if(!t)return c.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new c(t.map(e.nodeFromJSON))},c.fromArray=function(e){if(!e.length)return c.empty;for(var t,n=0,r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},f.prototype.removeFromSet=function(e){for(var t=0;te.depth)throw new m("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new m("Inconsistent open depths");return w(e,t,n,0)}function w(e,t,n,r){var o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0;o--)r=t.node(o).copy(c.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return E(i,z(e,s.start,s.end,t,r))}var l=e.parent,d=l.content;return E(l,d.cut(0,e.parentOffset).append(n.content).append(d.cut(t.parentOffset)))}return E(i,C(e,t,r))}function k(e,t){if(!t.type.compatibleContent(e.type))throw new m("Cannot join "+t.type.name+" onto "+e.type.name)}function _(e,t,n){var r=e.node(n);return k(r,t.node(n)),r}function M(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function S(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(M(e.nodeAfter,r),i++));for(var s=i;so&&_(e,t,o+1),a=r.depth>o&&_(n,r,o+1),s=[];return S(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(k(i,a),M(E(i,z(e,t,n,r,o+1)),s)):(i&&M(E(i,C(e,t,o+1)),s),S(t,n,o,s),a&&M(E(a,C(n,r,o+1)),s)),S(r,null,o,s),new c(s)}function C(e,t,n){var r=[];return S(null,e,n,r),e.depth>n&&M(E(_(e,t,n+1),C(e,t,n+1)),r),S(t,null,n,r),new c(r)}y.size.get=function(){return this.content.size-this.openStart-this.openEnd},g.prototype.insertAt=function(e,t){var n=b(this.content,e+this.openStart,t,null);return n&&new g(n,this.openStart,this.openEnd)},g.prototype.removeBetween=function(e,t){return new g(v(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},g.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},g.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},g.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},g.fromJSON=function(e,t){if(!t)return g.empty;var n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new g(c.fromJSON(e,t.content),n,r)},g.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new g(e,n,r)},Object.defineProperties(g.prototype,y),g.empty=new g(c.empty,0,0);var L=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},O={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};L.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},O.parent.get=function(){return this.node(this.depth)},O.doc.get=function(){return this.node(0)},L.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},L.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},L.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},L.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},L.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},L.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},L.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},O.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},O.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},O.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},L.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},L.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new P(this,e,n)},L.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},L.prototype.max=function(e){return e.pos>this.pos?e:this},L.prototype.min=function(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var a=i.content.findIndex(o),s=a.index,l=a.offset,c=o-l;if(n.push(i,s,r+l),!c)break;if((i=i.child(s)).isText)break;o=c-1,r+=l+1}return new L(t,n,o)},L.resolveCached=function(e,t){for(var n=0;ne&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r},B.isBlock.get=function(){return this.type.isBlock},B.isTextblock.get=function(){return this.type.isTextblock},B.inlineContent.get=function(){return this.type.inlineContent},B.isInline.get=function(){return this.type.isInline},B.isText.get=function(){return this.type.isText},B.isLeaf.get=function(){return this.type.isLeaf},B.isAtom.get=function(){return this.type.isAtom},R.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),$(this.marks,e)},R.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},R.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=c.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s=0;n--)t=e[n].type.name+"("+t+")";return t}var K=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},q={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};K.parse=function(e,t){var n=new F(e,t);if(null==n.next)return K.empty;var r=W(n);n.next&&n.err("Unexpected trailing text");var o,i,a=(o=function(e){var t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,i))}),[]);if("seq"==t.type)for(var a=0;;a++){var s=e(t.exprs[a],i);if(a==t.exprs.length-1)return s;o(s,i=n())}else{if("star"==t.type){var l=n();return r(i,l),o(e(t.expr,l),l),[r(l)]}if("plus"==t.type){var c=n();return o(e(t.expr,i),c),o(e(t.expr,c),c),[r(c)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){for(var d=i,u=0;u-1&&n[i+1];Y(o,r).forEach((function(e){a||n.push(t,a=[]),-1==a.indexOf(e)&&a.push(e)}))}}))}));for(var r=i[t.join(",")]=new K(t.indexOf(o.length-1)>-1),a=0;a>1},K.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},K.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r"+e.indexOf(t.next[o+1]);return r})).join("\n")},Object.defineProperties(K.prototype,q),K.empty=new K(!0);var F=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},H={next:{configurable:!0}};function W(e){var t=[];do{t.push(V(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function V(e){var t=[];do{t.push(U(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function U(e){for(var t=function(e){if(e.eat("(")){var t=W(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=G(e,t)}return t}function Z(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function G(e,t){var n=Z(e),r=n;return e.eat(",")&&(r="}"!=e.next?Z(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function X(e,t){return t-e}function Y(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i-1},te.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t-1};var ae=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=a.from(e.nodes),this.spec.marks=a.from(e.marks),this.nodes=te.compile(this.spec.nodes,this),this.marks=ie.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var o=this.nodes[r],i=o.spec.content||"",s=o.spec.marks;o.contentMatch=n[i]||(n[i]=K.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==s?null:s?se(this,s.split(" ")):""!=s&&o.inlineContent?null:[]}for(var l in this.marks){var c=this.marks[l],d=c.spec.excludes;c.excluded=null==d?[c]:""==d?[]:se(this,d.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function se(e,t){for(var n=[],r=0;r-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}ae.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof te))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)},ae.prototype.text=function(e,t){var n=this.nodes.text;return new j(n,n.defaultAttrs,e,f.setFrom(t))},ae.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},ae.prototype.nodeFromJSON=function(e){return R.fromJSON(this,e)},ae.prototype.markFromJSON=function(e){return f.fromJSON(this,e)},ae.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var le=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))};le.prototype.parse=function(e,t){void 0===t&&(t={});var n=new fe(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},le.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new fe(this,t,!0);return n.addAll(e,null,t.from,t.to),g.maxOpen(n.finish())},le.prototype.matchTag=function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=i.style.charCodeAt(e.length)||i.style.slice(e.length+1)!=t))){if(i.getAttrs){var a=i.getAttrs(t);if(!1===a)continue;i.attrs=a}return i}}},le.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},he.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;athis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},fe.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},fe.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},me.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},fe.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=i;s--)if(a(e-1,s))return!0;return!1}var c=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!c||c.name!=l&&-1==c.groups.indexOf(l))return!1;s--}return!0};return a(n.length-1,this.open)},fe.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},fe.prototype.addPendingMark=function(e){var t=function(e,t){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var o=r.popFromStashMark(e);o&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==t)break}},Object.defineProperties(fe.prototype,me);var be=function(e,t){this.nodes=e||{},this.marks=t||{}};function xe(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function we(e){return e.document||window.document}be.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=we(t).createDocumentFragment());var o=n,i=null;return e.forEach((function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,a=0;n=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},be.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&be.renderSpec(we(n),r(e,t))},be.renderSpec=function(e,t,n){if(void 0===n&&(n=null),"string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;var r=t[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,a=n?e.createElementNS(n,r):e.createElement(r),s=t[1],l=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s))for(var c in l=2,s)if(null!=s[c]){var d=c.indexOf(" ");d>0?a.setAttributeNS(c.slice(0,d),c.slice(d+1),s[c]):a.setAttribute(c,s[c])}for(var u=l;ul)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var h=be.renderSpec(e,p,n),f=h.dom,m=h.contentDOM;if(a.appendChild(f),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:a,contentDOM:i}},be.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new be(this.nodesFromSchema(e),this.marksFromSchema(e)))},be.nodesFromSchema=function(e){var t=xe(e.nodes);return t.text||(t.text=function(e){return e.text}),t},be.marksFromSchema=function(e){return xe(e.marks)};var ke=Math.pow(2,16);function _e(e){return 65535&e}var Me=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},Se=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};Se.prototype.recover=function(e){var t=0,n=_e(e);if(!this.inverted)for(var r=0;re)break;var l=this.ranges[a+o],c=this.ranges[a+i],d=s+l;if(e<=d){var u=s+r+((l?e==s?-1:e==d?1:t:t)<0?0:c);return n?u:new Me(u,t<0?e!=s:e!=d,e==(t<0?s:d)?null:a/3+(e-s)*ke)}r+=c-l}return n?e+r:new Me(e+r)},Se.prototype.touches=function(e,t){for(var n=0,r=_e(t),o=this.inverted?2:1,i=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o];if(e<=s+l&&a==3*r)return!0;n+=this.ranges[a+i]-l}return!1},Se.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},Ee.prototype.invert=function(){var e=new Ee;return e.appendMappingInverted(this),e},Ee.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;no&&a0},Ce.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(Ce.prototype,Le);var Te=Object.create(null),Ae=function(){};Ae.prototype.apply=function(e){return Oe()},Ae.prototype.getMap=function(){return Se.empty},Ae.prototype.invert=function(e){return Oe()},Ae.prototype.map=function(e){return Oe()},Ae.prototype.merge=function(e){return null},Ae.prototype.toJSON=function(){return Oe()},Ae.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Te[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},Ae.jsonID=function(e,t){if(e in Te)throw new RangeError("Duplicate use of step JSON ID "+e);return Te[e]=t,t.prototype.jsonID=e,t};var De=function(e,t){this.doc=e,this.failed=t};De.ok=function(e){return new De(e,null)},De.fail=function(e){return new De(null,e)},De.fromReplace=function(e,t,n,r){try{return De.ok(e.replace(t,n,r))}catch(e){if(e instanceof m)return De.fail(e.message);throw e}};var Pe=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&Ne(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new Se([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?g.empty:new g(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var r=this.slice.size+e.slice.size==0?g.empty:new g(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),r,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,g.fromJSON(e,n.slice),!!n.structure)},t}(Ae);Ae.jsonID("replace",Pe);var Ie=function(e){function t(t,n,r,o,i,a,s){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(Ne(e,this.from,this.gapFrom)||Ne(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?De.fromReplace(e,this.from,this.to,n):De.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new Se([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,g.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(Ae);function Ne(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function Re(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Be(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(ni;s--,l--){var c=o.node(s),d=o.index(s);if(c.type.spec.isolating)return!1;var u=c.content.cutByIndex(d,c.childCount),p=r&&r[l]||c;if(p!=c&&(u=u.replaceChild(0,p.type.create(p.attrs))),!c.canReplace(d+1,c.childCount)||!p.type.validContent(u))return!1}var h=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(h,h,f?f.type:o.node(i+1).type)}function $e(e,t){var n,r,o=e.resolve(t),i=o.index();return n=o.nodeBefore,r=o.nodeAfter,n&&r&&!n.isLeaf&&n.canAppend(r)&&o.parent.canReplace(i,i+1)}function Ke(e,t,n){for(var r=[],o=0;ot;p--)h||n.index(p)>0?(h=!0,d=c.from(n.node(p).copy(d)),u++):s--;for(var f=c.empty,m=0,y=o,v=!1;y>t;y--)v||r.after(y+1)=0;r--)n=c.from(t[r].type.create(t[r].attrs,n));var o=e.start,i=e.end;return this.step(new Ie(o,i,o,i,new g(n,0,0),t.length,!0))},Ce.prototype.setBlockType=function(e,t,n,r){var o=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,r)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(i).map(t),n)){o.clearIncompatible(o.mapping.slice(i).map(t,1),n);var a=o.mapping.slice(i),s=a.map(t,1),l=a.map(t+e.nodeSize,1);return o.step(new Ie(s,l,s+1,l-1,new g(c.from(n.create(r,null,e.marks)),0,0),1,!0)),!1}})),this},Ce.prototype.setNodeMarkup=function(e,t,n,r){var o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(e,e+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new Ie(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new g(c.from(i),0,0),1,!0))},Ce.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var r=this.doc.resolve(e),o=c.empty,i=c.empty,a=r.depth,s=r.depth-t,l=t-1;a>s;a--,l--){o=c.from(r.node(a).copy(o));var d=n&&n[l];i=c.from(d?d.type.create(d.attrs,i):r.node(a).copy(i))}return this.step(new Pe(e,e,new g(o.append(i),t,t),!0))},Ce.prototype.join=function(e,t){void 0===t&&(t=1);var n=new Pe(e-t,e+t,g.empty,!0);return this.step(n)};var qe=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new g(Ke(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),o),n.openStart,n.openEnd);return De.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new Fe(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(Ae);Ae.jsonID("addMark",qe);var Fe=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),r=new g(Ke(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return De.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new qe(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(Ae);function He(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ae.jsonID("removeMark",Fe),Ce.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],a=null,s=null;return this.doc.nodesBetween(e,t,(function(r,l,c){if(r.isInline){var d=r.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){for(var u=Math.max(l,e),p=Math.min(l+r.nodeSize,t),h=n.addToSet(d),f=0;f=0;h--)this.step(o[h]);return this},Ce.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=g.empty);var r=function(e,t,n,r){if(void 0===n&&(n=t),void 0===r&&(r=g.empty),t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return He(o,i,r)?new Pe(t,n,r):new We(o,i,r).fit()}(this.doc,e,t,n);return r&&this.step(r),this},Ce.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new g(c.from(n),0,0))},Ce.prototype.delete=function(e,t){return this.replace(e,t,g.empty)},Ce.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var We=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var r=0;r<=e.depth;r++){var o=e.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(r))})}this.placed=c.empty;for(var i=e.depth;i>0;i--)this.placed=c.from(e.node(i).copy(this.placed))},Ve={depth:{configurable:!0}};function Ue(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(Ue(e.firstChild.content,t-1,n)))}function Ze(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ze(e.lastChild.content,t-1,n)))}function Ge(e,t){for(var n=0;n1&&(r=r.replaceChild(0,Xe(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(c.empty,!0)))),e.copy(r)}function Ye(e,t,n,r,o){var i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(e,t,n){for(var r=n;rr){var a=o.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(c.empty,!0))}return e}function Qe(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;o==t.start(r)&&n.push(r)}return n}Ve.depth.get=function(){return this.frontier.length-1},We.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;for(var i=this.placed,a=r.depth,s=o.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var l=new g(i,a,s);return t>-1?new Ie(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Pe(r.pos,o.pos,l):void 0},We.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,r=(t?(n=Ge(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],a=i.type,s=i.match,l=void 0,d=void 0;if(1==e&&(r?s.matchType(r.type)||(d=s.fillBefore(c.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:d};if(2==e&&r&&(l=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:l};if(n&&s.matchType(n.type))break}},We.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=Ge(t,n);return!(!o.childCount||o.firstChild.isLeaf||(this.unplaced=new g(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),0))},We.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=Ge(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new g(Ue(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new g(Ue(t,n,1),n,r)},We.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,o=e.inject,i=e.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var a=0;a1||0==d||b.content.size)&&(f=x,p.push(Xe(b.mark(m.allowedMarks(b.marks)),1==u?d:0,u==l.childCount?v:-1)))}var w=u==l.childCount;w||(v=-1),this.placed=Ze(this.placed,n,c.from(p)),this.frontier[n].match=f,w&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var k=0,_=l;k1&&r==this.$to.end(--n);)++r;return r},We.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t=0;s--){var l=this.frontier[s],c=l.match,d=Ye(e,s,l.type,c,!0);if(!d||d.childCount)continue e}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}},We.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ze(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e},We.prototype.openFrontierNode=function(e,t,n){var r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Ze(this.placed,this.depth,c.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},We.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(c.empty,!0);e.childCount&&(this.placed=Ze(this.placed,this.frontier.length,e))},Object.defineProperties(We.prototype,Ve),Ce.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var r=this.doc.resolve(e),o=this.doc.resolve(t);if(He(r,o,n))return this.step(new Pe(e,t,n));var i=Qe(r,this.doc.resolve(t));0==i[i.length-1]&&i.pop();var a=-(r.depth+1);i.unshift(a);for(var s=r.depth,l=r.pos-1;s>0;s--,l--){var c=r.node(s).type.spec;if(c.defining||c.isolating)break;i.indexOf(s)>-1?a=s:r.before(s)==l&&i.splice(1,0,-s)}for(var d=i.indexOf(a),u=[],p=n.openStart,h=n.content,f=0;;f++){var m=h.firstChild;if(u.push(m),f==n.openStart)break;h=m.content}p>0&&u[p-1].type.spec.defining&&r.node(d).type!=u[p-1].type?p-=1:p>=2&&u[p-1].isTextblock&&u[p-2].type.spec.defining&&r.node(d).type!=u[p-2].type&&(p-=2);for(var y=n.openStart;y>=0;y--){var v=(y+p+1)%(n.openStart+1),b=u[v];if(b)for(var x=0;x=0&&(this.replace(e,t,n),!(this.steps.length>S));E--){var z=i[E];E<0||(e=r.before(z),t=o.after(z))}return this},Ce.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var r=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s0&&(s||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return this.delete(n.before(a),r.after(a))}for(var l=1;l<=n.depth&&l<=r.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l)&&r.end(l)-t!=r.depth-l)return this.delete(n.before(l),t);return this.delete(e,t)};var et=Object.create(null),tt=function(e,t,n){this.ranges=n||[new rt(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},nt={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};nt.anchor.get=function(){return this.$anchor.pos},nt.head.get=function(){return this.$head.pos},nt.from.get=function(){return this.$from.pos},nt.to.get=function(){return this.$to.pos},nt.$from.get=function(){return this.ranges[0].$from},nt.$to.get=function(){return this.ranges[0].$to},nt.empty.get=function(){for(var e=this.ranges,t=0;t=0;o--){var i=t<0?dt(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):dt(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},tt.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new lt(e.node(0))},tt.atStart=function(e){return dt(e,e,0,0,1)||new lt(e)},tt.atEnd=function(e){return dt(e,e,e.content.size,e.childCount,-1)||new lt(e)},tt.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=et[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},tt.jsonID=function(e,t){if(e in et)throw new RangeError("Duplicate use of selection JSON ID "+e);return et[e]=t,t.prototype.jsonID=e,t},tt.prototype.getBookmark=function(){return ot.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(tt.prototype,nt),tt.prototype.visible=!0;var rt=function(e,t){this.$from=e,this.$to=t},ot=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=g.empty),e.prototype.replace.call(this,t,n),n==g.empty){var r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new it(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var a=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!a)return e.near(r,o);r=a.$head}return n.parent.inlineContent||(0==i||(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?a=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&at.isSelectable(s))return at.create(e,n-(o<0?s.nodeSize:0))}else{var l=dt(e,s,n+o,o<0?s.childCount:0,o,i);if(l)return l}n+=s.nodeSize*o}}function ut(e,t,n){var r=e.steps.length-1;if(!(r0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return f.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||f.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(tt.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(Ce);function ht(e,t){return t&&e?e.bind(t):e}var ft=function(e,t,n){this.name=e,this.init=ht(t.init,n),this.apply=ht(t.apply,n)},mt=[new ft("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new ft("selection",{init:function(e,t){return e.selection||tt.atStart(t.doc)},apply:function(e){return e.selection}}),new ft("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ft("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],gt=function(e,t){var n=this;this.schema=e,this.fields=mt.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new ft(e.key,e.spec.state,e))}))},yt=function(e){this.config=e},vt={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};vt.schema.get=function(){return this.config.schema},vt.plugins.get=function(){return this.config.plugins},yt.prototype.apply=function(e){return this.applyTransaction(e).state},yt.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n-1&&bt.splice(t,1)},Object.defineProperties(yt.prototype,vt);var bt=[];function xt(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=xt(o,t,{})),n[r]=o}return n}var wt=function(e){this.props={},e.props&&xt(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:_t("plugin")};wt.prototype.getState=function(e){return e[this.key]};var kt=Object.create(null);function _t(e){return e in kt?e+"$"+ ++kt[e]:(kt[e]=0,e+"$")}var Mt=function(e){void 0===e&&(e="key"),this.key=_t(e)};Mt.prototype.get=function(e){return e.config.pluginsByKey[this.key]},Mt.prototype.getState=function(e){return e[this.key]};var St={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var Et=/Edge\/(\d+)/.exec(navigator.userAgent),zt=/MSIE \d/.test(navigator.userAgent),Ct=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);St.mac=/Mac/.test(navigator.platform);var Lt=St.ie=!!(zt||Ct||Et);St.ie_version=zt?document.documentMode||6:Ct?+Ct[1]:Et?+Et[1]:null,St.gecko=!Lt&&/gecko\/(\d+)/i.test(navigator.userAgent),St.gecko_version=St.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var Ot=!Lt&&/Chrome\/(\d+)/.exec(navigator.userAgent);St.chrome=!!Ot,St.chrome_version=Ot&&+Ot[1],St.safari=!Lt&&/Apple Computer/.test(navigator.vendor),St.ios=St.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),St.android=/Android \d/.test(navigator.userAgent),St.webkit="webkitFontSmoothing"in document.documentElement.style,St.webkit_version=St.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Tt=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},At=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},Dt=null,Pt=function(e,t,n){var r=Dt||(Dt=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},It=function(e,t,n,r){return n&&(Rt(e,t,n,r,-1)||Rt(e,t,n,r,1))},Nt=/^(img|br|input|textarea|hr)$/i;function Rt(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Bt(e))){var i=e.parentNode;if(1!=i.nodeType||jt(e)||Nt.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Tt(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Bt(e):0}}}function Bt(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function jt(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var $t=function(e){var t=e.isCollapsed;return t&&St.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Kt(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function qt(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ft(e,t){return"number"==typeof e?e:e[t]}function Ht(e){var t=e.getBoundingClientRect();return{left:t.left,right:t.left+e.clientWidth,top:t.top,bottom:t.top+e.clientHeight}}function Wt(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=At(a))if(1==a.nodeType){var s=a==i.body||1!=a.nodeType,l=s?qt(i):Ht(a),c=0,d=0;if(t.topl.bottom-Ft(r,"bottom")&&(d=t.bottom-l.bottom+Ft(o,"bottom")),t.leftl.right-Ft(r,"right")&&(c=t.right-l.right+Ft(o,"right")),c||d)if(s)i.defaultView.scrollBy(c,d);else{var u=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);var h=a.scrollLeft-u,f=a.scrollTop-p;t={left:t.left-h,top:t.top-f,right:t.right-h,bottom:t.bottom-f}}if(s)break}}function Vt(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=At(e));return t}function Ut(e,t){for(var n=0;n=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);var h=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:Gt(n,r)}function Xt(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Yt(e,t,n){var r=e.childNodes.length;if(r&&n.topt.top&&i++}o==e.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?c=e.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(c=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)o=a.posBefore;else{if(!(s.right-1?o:e.docView.posFromDOM(t,n)}(e,o,i,t))}null==c&&(c=function(e,t,n){var r=Gt(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,d,t));var f=e.docView.nearestDesc(d,!0);return{pos:c,inside:f?f.posAtStart-f.border:-1}}function Qt(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var en=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tn(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=St.webkit||St.gecko;if(3==o.nodeType){if(!a||!en.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var s=i,l=i,c=n<0?1:-1;return n<0&&!i?(l++,c=-1):n>=0&&i==o.nodeValue.length?(s--,c=1):n<0?s--:l++,nn(Qt(Pt(o,s,l),c),c<0)}var d=Qt(Pt(o,i,i),n);if(St.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==Bt(o))){var m=o.childNodes[i-1],g=3==m.nodeType?Pt(m,Bt(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(g)return nn(Qt(g,1),!1)}if(i=0)}function nn(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function rn(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function on(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var an=/[\u0590-\u08ac]/,sn=null,ln=null,cn=!1,dn=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},un={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0}};dn.prototype.matchesWidget=function(){return!1},dn.prototype.matchesMark=function(){return!1},dn.prototype.matchesNode=function(){return!1},dn.prototype.matchesHack=function(){return!1},un.beforePosition.get=function(){return!1},dn.prototype.parseRule=function(){return null},dn.prototype.stopEvent=function(){return!1},un.size.get=function(){for(var e=0,t=0;t0:s)?this.posAtEnd:this.posAtStart},dn.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==e.nodeType?e:e.parentNode):o.nodeDOM==e))return o;n=!1}}},dn.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},dn.prototype.posFromDOM=function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1},dn.prototype.descAt=function(e){for(var t=0,n=0;t=e:a>e))return i.domFromPos(e-n-i.border,t);n=a}},dn.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==r&&e<=l){var c=i+s.border;if(e>=c&&t<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,c);e=i;for(var d=a;d>0;d--){var u=this.children[d-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){r=Tt(u.dom)+1;break}e-=u.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(var p=a+1;ps&&it){var g=d;d=u,u=g}var y=document.createRange();y.setEnd(u.node,u.offset),y.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(y)}}},dn.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},un.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},dn.prototype.markDirty=function(e,t){for(var n=0,r=0;r=n:en){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=3}n=i}this.dirty=2},dn.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=An(i,0,e,r));for(var s=0;si;)s.push(o[a++]);var g=i+h.nodeSize;if(h.isText){var y=g;a=0&&!s&&a.syncToMarks(i==n.node.childCount?f.none:n.node.child(i).marks,r,e),a.placeWidget(t,e,o)}),(function(t,n,i,s){a.syncToMarks(t.marks,r,e),a.findNodeMatch(t,n,i,s)||a.updateNextNode(t,n,i,e,s)||a.addNode(t,n,i,e,o),o+=t.nodeSize})),a.syncToMarks(pn,r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),wn(this.contentDOM,this.children,e),St.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))},t.prototype.localCompositionNode=function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(!(e.state.selection instanceof ot)||rt+this.node.content.size)){var i=e.root.getSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Bt(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){var d=l.lastIndexOf(t,r-s);if(d>=0&&d+t.length+s>=n)return s+d}}}return-1}(this.node.content,s,r-t,o-t);return l<0?null:{node:a,pos:l,text:s}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var a=new fn(this,i,n,o);e.compositionNodes.push(a),this.children=An(this.children,r,r+o.length,e,a)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!Cn(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Sn(this.dom,this.nodeDOM,Mn(this.outerDeco,this.node,t),Mn(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,n),t}(dn);function yn(e,t,n,r,o){return zn(r,t,e),new gn(null,e,t,n,r,r,r,o,0)}var vn=function(e){function t(t,n,r,o,i,a,s){e.call(this,t,n,r,o,i,null,a,s)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},n.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,n),t}(gn),bn=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},n.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,n),t}(dn),xn=function(e){function t(t,n,r,o,i,a,s,l,c,d){e.call(this,t,n,r,o,i,a,s,c,d),this.spec=l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(gn);function wn(e,t,n){for(var r=e.firstChild,o=!1,i=0;i0&&o>=0;o--){var i=t[o],a=i.node;if(a){if(a!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function Tn(e,t){return e.type.side-t.type.side}function An(e,t,n,r,o){for(var i=[],a=0,s=0;a=n||d<=t?i.push(l):(cn&&i.push(l.slice(n-c,l.size,r)))}return i}function Dn(e,t){var n=e.root.getSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var s,l,c=r.resolve(a);if($t(n)){for(s=c;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&at.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(e,t,n){for(var r=0==t,o=t==Bt(e);r||o;){if(e==n)return!0;var i=Tt(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==Bt(e)}}(n.focusNode,n.focusOffset,o.dom))){var d=o.posBefore;l=new at(a==d?c:r.resolve(d))}}else{var u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(u<0)return null;s=r.resolve(u)}return l||(l=Kn(e,s,c,"pointer"==t||e.state.selection.head=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},On.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=mn.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}},On.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),a=this.top.children;if(i&&i.matchesNode(e,t,n))o=a.indexOf(i);else for(var s=this.index,l=Math.min(a.length,s+5);s-1&&s+this.preMatchOffset!=o)return!1;var l=a.dom;if((!this.lock||!(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))||e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Cn(t,a.outerDeco))&&a.update(e,t,n,r))return this.destroyBetween(this.index,i),a.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1},On.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,gn.create(this.top,e,t,n,r,o)),this.changed=!0},On.prototype.placeWidget=function(e,t,n){var r=this.index0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&tt.findFrom(a,t)}function Hn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Wn(e,t,n){var r=e.state.selection;if(!(r instanceof ot)){if(r instanceof at&&r.node.isInline)return Hn(e,new ot(t>0?r.$to:r.$from));var o=Fn(e.state,t);return!!o&&Hn(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=Fn(e.state,t);return!!(i&&i instanceof at)&&Hn(e,i)}if(!(St.mac&&n.indexOf("m")>-1)){var a,s=r.$head,l=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var c=t<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=e.docView.descAt(c))&&!a.contentDOM)&&(at.isSelectable(l)?Hn(e,new at(t<0?e.state.doc.resolve(s.pos-l.nodeSize):s)):!!St.webkit&&Hn(e,new ot(e.state.doc.resolve(t<0?c:c+l.nodeSize))))}}function Vn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Un(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Zn(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(St.gecko&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(Un(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(Xn(n))break;for(var l=n.previousSibling;l&&Un(l);)o=n.parentNode,i=Tt(l),l=l.previousSibling;if(l)r=Vn(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Yn(e,t,n,r):o&&Yn(e,t,o,i)}}function Gn(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=Vn(n);;)if(r-1)return!1;if(St.mac&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Fn(e.state,t);if(a&&a instanceof at)return Hn(e,a)}if(!o.parent.inlineContent){var s=tt.findFrom(t<0?o:i,t);return!s||Hn(e,s)}return!1}function Qn(e,t){if(!(e.state.selection instanceof ot))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function er(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function tr(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(St.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||St.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function nr(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Kn(e,t.resolve(n.anchor),t.resolve(n.head))}function rr(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function or(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||be.fromSchema(e.state.schema),l=pr(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));for(var d,u=c.firstChild;u&&1==u.nodeType&&(d=dr[u.nodeName.toLowerCase()]);){for(var p=d.length-1;p>=0;p--){for(var h=l.createElement(d[p]);c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h)}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:c,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function ir(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return new g(c.from(e.state.schema.text(t)),0,0);var d=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));d?a=d:(i=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach((function(e){i.appendChild(document.createElement("p")).textContent=e})))}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=pr().createElement("div"),o=/(?:]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&dr[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""),i=n.length),r.innerHTML=e;for(var a=0;a=0;s-=2){var l=r.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;o=c.from(l.create(n[s+1],o)),i++,a++}return new g(o,i,a)}(function(e,t,n){return t=0;r--){var o=n(r);if(o)return o.v}return e}(a.content,o),!1),e.someProp("transformPasted",(function(e){a=e(a)})),a}function ar(e,t,n){void 0===n&&(n=0);for(var r=t.length-1;r>=n;r--)e=t[r].create(null,c.from(e));return e}function sr(e,t,n,r,o){if(o=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(c.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}var dr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},ur=null;function pr(){return ur||(ur=document.implementation.createHTMLDocument("title"))}var hr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fr=St.ie&&St.ie_version<=11,mr=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};mr.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},mr.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var gr=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;te.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new mr,fr&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};gr.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))},gr.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},gr.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,hr),fr&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},gr.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&qn(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s1){var c=a.filter((function(e){return"BR"==e.nodeName}));if(2==c.length){var d=c[0],u=c[1];d.parentNode&&d.parentNode.parentNode==u.parentNode?u.remove():d.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),p=this.view,yr||(yr=!0,"normal"==getComputedStyle(p.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."))),this.handleDOMChange(r,o,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Pn(this.view))}var p},gr.prototype.registerMutation=function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){var r=e.previousSibling,o=e.nextSibling;if(St.ie&&St.ie_version<=11&&e.addedNodes.length)for(var i=0;ii.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if(l)return l.v}return!1}function Sr(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Er(e,t,n,r){return Mr(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function zr(e,t,n,r){return Mr(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(Sr(e,ot.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(t),o=r.depth+1;o>0;o--){var i=o>r.depth?r.nodeAfter:r.node(o),a=r.before(o);if(i.inlineContent)Sr(e,ot.create(n,a+1,a+1+i.content.size),"pointer");else{if(!at.isSelectable(i))continue;Sr(e,at.create(n,a),"pointer")}return!0}}(e,n)}function Cr(e){return Ir(e)}br.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!Tr(e,t))if(e.domObserver.forceFlush(),e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!St.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",(function(n){return n(e,t)}))||function(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||St.mac&&72==n&&"c"==r?Qn(e,-1)||Zn(e):46==n||St.mac&&68==n&&"c"==r?Qn(e,1)||Gn(e):13==n||27==n||(37==n?Wn(e,-1,r)||Zn(e):39==n?Wn(e,1,r)||Gn(e):38==n?Jn(e,-1,r)||Zn(e):40==n?function(e){if(St.safari&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;er(e,o,!0),setTimeout((function(){return er(e,o,!1)}),20)}}}(e)||Jn(e,1,r)||Gn(e):r==(St.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}(e,t)?t.preventDefault():xr(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout((function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",(function(t){return t(e,Kt(13,"Enter"))})),e.lastIOSEnter=0)}),200)}},br.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},br.keypress=function(e,t){if(!(Tr(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||St.mac&&t.metaKey))if(e.someProp("handleKeyPress",(function(n){return n(e,t)})))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof ot&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(t.charCode);e.someProp("handleTextInput",(function(t){return t(e,n.$from.pos,n.$to.pos,r)}))||e.dispatch(e.state.tr.insertText(r).scrollIntoView()),t.preventDefault()}}};var Lr=St.mac?"metaKey":"ctrlKey";vr.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=Cr(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[Lr]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(_r(t));i&&("singleClick"==o?e.mouseDown=new Or(e,i,t,n):("doubleClick"==o?Er:zr)(e,i.pos,i.inside,t)?t.preventDefault():xr(e,"pointer"))};var Or=function(e,t,n,r){var o,i,a=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=r,this.selectNode=n[Lr],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{var s=e.state.doc.resolve(t.pos);o=s.parent,i=s.depth?s.before():0}this.mightDrag=null;var l=r?null:n.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c?c.dom:null,(o.type.spec.draggable&&!1!==o.type.spec.selectable||e.state.selection instanceof at&&i==e.state.selection.from)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&St.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){return a.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),xr(e,"pointer")};function Tr(e,t){return!!e.composing||!!(St.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}Or.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},Or.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(_r(e))),this.allowDefault||!t?xr(this.view,"pointer"):function(e,t,n,r,o){return Mr(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof at&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(at.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(Sr(e,at.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&at.isSelectable(r))&&(Sr(e,new at(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():this.flushed||St.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||St.chrome&&!(this.view.state.selection instanceof ot)&&(t.pos==this.view.state.selection.from||t.pos==this.view.state.selection.to)?(Sr(this.view,tt.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):xr(this.view,"pointer")}},Or.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),xr(this.view,"pointer")},vr.touchdown=function(e){Cr(e),xr(e,"pointer")},vr.contextmenu=function(e){return Cr(e)};var Ar=St.android?5e3:-1;function Dr(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout((function(){return Ir(e)}),t))}function Pr(e){for(e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function Ir(e,t){if(e.domObserver.forceFlush(),Pr(e),t||e.docView.dirty){var n=Dn(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}br.compositionstart=br.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),Ir(e,!0),e.markCursor=null;else if(Ir(e),St.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.composing=!0}Dr(e,Ar)},br.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,Dr(e,20))};var Nr=St.ie&&St.ie_version<15||St.ios&&St.webkit_version<604;function Rr(e,t,n,r){var o=ir(e,t,n,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||g.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}vr.copy=br.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=Nr?null:t.clipboardData,i=or(e,n.content()),a=i.dom,s=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",s)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,a),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},br.paste=function(e,t){var n=Nr?null:t.clipboardData;n&&Rr(e,n.getData("text/plain"),n.getData("text/html"),t)?t.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Rr(e,r.value,null,t):Rr(e,r.textContent,r.innerHTML,t)}),50)}}(e,t)};var Br=function(e,t){this.slice=e,this.move=t},jr=St.mac?"altKey":"ctrlKey";for(var $r in vr.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var r=e.state.selection,o=r.empty?null:e.posAtCoords(_r(t));if(o&&o.pos>=r.from&&o.pos<=(r instanceof at?r.to-1:r.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(at.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var i=e.docView.nearestDesc(t.target,!0);if(!i||!i.node.type.spec.draggable||i==e.docView)return;e.dispatch(e.state.tr.setSelection(at.create(e.state.doc,i.posBefore)))}var a=e.state.selection.content(),s=or(e,a),l=s.dom,c=s.text;t.dataTransfer.clearData(),t.dataTransfer.setData(Nr?"Text":"text/html",l.innerHTML),Nr||t.dataTransfer.setData("text/plain",c),e.dragging=new Br(a,!t[jr])}},vr.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},br.dragover=br.dragenter=function(e,t){return t.preventDefault()},br.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var r=e.posAtCoords(_r(t));if(r){var o=e.state.doc.resolve(r.pos);if(o){var i=n&&n.slice||ir(e,t.dataTransfer.getData(Nr?"Text":"text/plain"),Nr?null:t.dataTransfer.getData("text/html"),!1,o),a=n&&!t[jr];if(e.someProp("handleDrop",(function(n){return n(e,t,i||g.empty,a)})))t.preventDefault();else if(i){t.preventDefault();var s=i?function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i=0;s--){var l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0);if(1==a?r.node(s).canReplace(c,c,o):r.node(s).contentMatchAt(c).findWrapping(o.firstChild.type))return 0==l?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}(e.state.doc,o.pos,i):o.pos;null==s&&(s=o.pos);var l=e.state.tr;a&&l.deleteSelection();var c=l.mapping.map(s),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),!l.doc.eq(u)){var p=l.doc.resolve(c);if(d&&at.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new at(p));else{var h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((function(e,t,n,r){return h=r})),l.setSelection(Kn(e,p,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}}}}}},vr.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&Pn(e)}),20))},vr.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.domObserver.currentSelection.set({}),e.focused=!1)},vr.beforeinput=function(e,t){if(St.chrome&&St.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout((function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,Kt(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},br)vr[$r]=br[$r];function Kr(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var qr=function(e,t){this.spec=t||Zr,this.side=this.spec.side||0,this.toDOM=e};qr.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Wr(i-n,i-n,this)},qr.prototype.valid=function(){return!0},qr.prototype.eq=function(e){return this==e||e instanceof qr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Kr(this.spec,e.spec))};var Fr=function(e,t){this.spec=t||Zr,this.attrs=e};Fr.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Wr(o,i,this)},Fr.prototype.valid=function(e,t){return t.from=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;se){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,o)}},Gr.prototype.map=function(e,t,n){return this==Xr||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Zr)},Gr.prototype.mapInner=function(e,t,n,r,o){for(var i,a=0;al+i||(t>=s[a]+i?s[a+1]=-1:n>=o&&(c=r-n-(t-e))&&(s[a]+=c,s[a+1]+=c))}},c=0;c=r.content.size){d=!0;continue}var f=n.map(e[u+1]+i,-1)-o,m=r.content.findIndex(h),g=m.index,y=m.offset,v=r.maybeChild(g);if(v&&y==h&&y+v.nodeSize==f){var b=s[u+2].mapInner(n,v,p+1,e[u]+i+1,a);b!=Xr?(s[u]=h,s[u+1]=f,s[u+2]=b):(s[u+1]=-2,d=!0)}else d=!0}if(d){var x=to(function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;ia&&c.to=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,a=i+t.content.size,s=0;si&&l.type instanceof Fr){var c=Math.max(i,l.from)-i,d=Math.min(a,l.to)-i;cn&&a.to0;)t++;e.splice(t,0,n)}function io(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=Xr&&t.push(r)})),e.cursorWrapper&&t.push(Gr.create(e.state.doc,[e.cursorWrapper.deco])),Yr.from(t)}Yr.prototype.forChild=function(e,t){if(t.isLeaf)return Gr.empty;for(var n=[],r=0;rDate.now()-50?e.lastSelectionOrigin:null,a=Dn(e,i);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==i?s.setMeta("pointer",!0):"key"==i&&s.scrollIntoView(),e.dispatch(s)}}else{var l=e.state.doc.resolve(t),d=l.sharedDepth(n);t=l.before(d+1),n=e.state.doc.resolve(n).after(d+1);var u=e.state.selection,p=function(e,t,n){var r=e.docView.parseRange(t,n),o=r.node,i=r.fromOffset,a=r.toOffset,s=r.from,l=r.to,c=e.root.getSelection(),d=null,u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],$t(c)||d.push({node:c.focusNode,offset:c.focusOffset})),St.chrome&&8===e.lastKeyCode)for(var p=a;p>i;p--){var h=o.childNodes[p-1],f=h.pmViewDesc;if("BR"==h.nodeType&&!f){a=p;break}if(!f||f.size)break}var m=e.state.doc,g=e.someProp("domParser")||le.fromSchema(e.state.schema),y=m.resolve(s),v=null,b=g.parse(o,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:a,preserveWhitespace:!y.parent.type.spec.code||"full",editableContent:!0,findPositions:d,ruleFromNode:tr,context:y});if(d&&null!=d[0].pos){var x=d[0].pos,w=d[1]&&d[1].pos;null==w&&(w=x),v={anchor:x+s,head:w+s}}return{doc:b,sel:v,from:s,to:l}}(e,t,n);if(St.chrome&&e.cursorWrapper&&p.sel&&p.sel.anchor==e.cursorWrapper.deco.from){var h=e.cursorWrapper.deco.type.toDOM.nextSibling,f=h&&h.nodeValue?h.nodeValue.length:1;p.sel={anchor:p.sel.anchor+f,head:p.sel.anchor+f}}var m,g,y=e.state.doc,v=y.slice(p.from,p.to);8===e.lastKeyCode&&Date.now()-100=s?i-r:0)+(l-s),s=i):l=l?i-r:0)+(s-l),l=i),{start:i,endA:s,endB:l}}(v.content,p.doc.content,p.from,m,g);if(!b){if(!(r&&u instanceof ot&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(St.ios&&e.lastIOSEnter>Date.now()-225&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&e.someProp("handleKeyDown",(function(t){return t(e,Kt(13,"Enter"))})))return void(e.lastIOSEnter=0);if(p.sel){var x=nr(e,e.state.doc,p.sel);x&&!x.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(x))}return}b={start:u.from,endA:u.to,endB:u.to}}e.domChangeCount++,e.state.selection.frome.state.selection.from&&b.start<=e.state.selection.from+2?b.start=e.state.selection.from:b.endA=e.state.selection.to-2&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),St.ie&&St.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&"  "==p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)&&(b.start--,b.endA--,b.endB--);var w,k=p.doc.resolveNoCache(b.start-p.from),_=p.doc.resolveNoCache(b.endB-p.from),M=k.sameParent(_)&&k.parent.inlineContent;if((St.ios&&e.lastIOSEnter>Date.now()-225&&(!M||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!M&&k.posb.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||rr(r,!0,!1)n||rr(a,!0,!1)r.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,l,s);!d&&e.selection.eq(r.selection)||(i=!0);var u,p,h,f,m,g,y,v="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a=o-20){t=s,n=l.top;break}}}return{refDOM:t,refTop:n,stack:Vt(e.dom)}}(this);if(i){this.domObserver.stop();var b=d&&(St.ie||St.chrome)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(d){var x=St.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(e.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=yn(e.doc,l,s,this.dom,this)),x&&!this.trackWrites&&(b=!0)}b||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(u=this,p=u.docView.domFromPos(u.state.selection.anchor,0),h=u.root.getSelection(),It(p.node,p.offset,h.anchorNode,h.anchorOffset)))?Pn(this,b):(jn(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==c)this.dom.scrollTop=0;else if("to selection"==c){var w=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(e){return e(n)}))||(e.selection instanceof at?Wt(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),w):Wt(this,this.coordsAtPos(e.selection.head,1),w))}else v&&(m=(f=v).refDOM,g=f.refTop,Ut(f.stack,0==(y=m?m.getBoundingClientRect().top:0)?0:y-g))},ao.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},ao.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;tc.top&&("up"==n?c.bottomi.bottom-1))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=getSelection();return an.test(r.parent.textContent)&&s.modify?on(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?i:a}(e,t,n))}(this,t||this.state,e)},ao.prototype.destroy=function(){this.docView&&(function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout),clearTimeout(e.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],io(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},ao.prototype.dispatchEvent=function(e){return function(e,t){kr(e,t)||!vr[t.type]||!e.editable&&t.type in br||vr[t.type](e,t)}(this,e)},ao.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(ao.prototype,so);var fo=r.createElement("path",{fill:"currentColor",d:"M571.31 251.31l-22.62-22.62c-6.25-6.25-16.38-6.25-22.63 0L480 274.75l-46.06-46.06c-6.25-6.25-16.38-6.25-22.63 0l-22.62 22.62c-6.25 6.25-6.25 16.38 0 22.63L434.75 320l-46.06 46.06c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L480 365.25l46.06 46.06c6.25 6.25 16.38 6.25 22.63 0l22.62-22.62c6.25-6.25 6.25-16.38 0-22.63L525.25 320l46.06-46.06c6.25-6.25 6.25-16.38 0-22.63zM552 0H307.65c-14.54 0-27.26 9.8-30.95 23.87l-84.79 322.8-58.41-106.1A32.008 32.008 0 00105.47 224H24c-13.25 0-24 10.74-24 24v48c0 13.25 10.75 24 24 24h43.62l88.88 163.73C168.99 503.5 186.3 512 204.94 512c17.27 0 44.44-9 54.28-41.48L357.03 96H552c13.25 0 24-10.75 24-24V24c0-13.26-10.75-24-24-24z"});function mo(e){return r.createElement("svg",ho({"aria-hidden":"true","data-prefix":"fas","data-icon":"square-root-alt",className:"square-root-alt-solid_svg__svg-inline--fa square-root-alt-solid_svg__fa-square-root-alt square-root-alt-solid_svg__fa-w-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},e),fo)}n.p;var go=new ae({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:function(){return["p",0]},parseDOM:[{tag:"p"}]},mathlive:{group:"inline math",content:"text*",inline:!0,atom:!0,code:!0,toDOM:function(e){return["div",{class:"math-node"},0]},parseDOM:[{tag:"div"}]},text:{group:"inline"}}});function yo(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function vo(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=wo(r);if(!o){var i=r.blockRange(),a=i&&Be(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&Lo(e,o,t))return!0;if(0==r.parent.content.size&&(bo(s,"end")||at.isSelectable(s))){if(t){var l=e.tr.deleteRange(r.before(),r.after());l.setSelection(bo(s,"end")?tt.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):at.create(l.doc,o.pos-s.nodeSize)),t(l.scrollIntoView())}return!0}return!(!s.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),0))}function bo(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function xo(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=wo(o)}var a=i&&i.nodeBefore;return!(!a||!at.isSelectable(a)||(t&&t(e.tr.setSelection(at.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),0))}function wo(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function ko(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){var n=e.node(t);if(e.index(t)+11&&n.after()!=n.end(-1)){var r=n.before();if(je(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Be(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)}function Co(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof at&&e.selection.node.isBlock)return!(!r.parentOffset||!je(e.doc,r.pos)||(t&&t(e.tr.split(r.pos).scrollIntoView()),0));if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,a=e.tr;e.selection instanceof ot&&a.deleteSelection();var s=0==r.depth?null:So(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=i&&s?[{type:s}]:null,d=je(a.doc,a.mapping.map(r.pos),1,l);l||d||!je(a.doc,a.mapping.map(r.pos),1,s&&[{type:s}])||(l=[{type:s}],d=!0),d&&(a.split(a.mapping.map(r.pos),1,l),i||r.parentOffset||r.parent.type==s||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),c.from([s.create(),r.parent]))||a.setNodeMarkup(a.mapping.map(r.before()),s)),t(a.scrollIntoView())}return!0}function Lo(e,t,n){var r,o,i=t.nodeBefore,a=t.nodeAfter;if(i.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!$e(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;var s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var l=t.pos+a.nodeSize,d=c.empty,u=r.length-1;u>=0;u--)d=c.from(r[u].create(null,d));d=c.from(i.copy(d));var p=e.tr.step(new Ie(t.pos-1,l,t.pos,l,new g(d,1,0),r.length,!0)),h=l+2*r.length;$e(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}var f=tt.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),y=m&&Be(m);if(null!=y&&y>=t.depth)return n&&n(e.tr.lift(m,y).scrollIntoView()),!0;if(s&&a.isTextblock&&bo(i,"end")){for(var v=i,b=[];b.push(v),!v.isTextblock;)v=v.lastChild;if(v.canReplace(v.childCount,v.childCount,a.content)){if(n){for(var x=c.empty,w=b.length-1;w>=0;w--)x=c.from(b[w].copy(x));n(e.tr.step(new Ie(t.pos-b.length,t.pos+a.nodeSize,t.pos+1,t.pos+a.nodeSize-1,new g(x,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Oo(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Do="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Po="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Io="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),No="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ro="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Bo=Do&&(No||+Do[1]<57)||Io&&No,jo=0;jo<10;jo++)To[48+jo]=To[96+jo]=String(jo);for(jo=1;jo<=24;jo++)To[jo+111]="F"+jo;for(jo=65;jo<=90;jo++)To[jo]=String.fromCharCode(jo+32),Ao[jo]=String.fromCharCode(jo);for(var $o in To)Ao.hasOwnProperty($o)||(Ao[$o]=To[$o]);var Ko="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function qo(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s=t?Wo.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Wo.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Wo.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Wo.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Wo.from=function(e){return e instanceof Wo?e:e&&e.length?new Vo(e):Wo.empty};var Vo=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ho)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ho)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Wo);Wo.empty=new Vo([]);var Uo=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Wo),Zo=Wo,Go=function(e,t){this.items=e,this.eventCount=t};Go.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--)if(this.items.get(i-1).selection){--i;break}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var a,s,l=e.tr,c=[],d=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void d.push(e);if(r){d.push(new Xo(e.map));var u,p=e.step.map(r.slice(o));p&&l.maybeStep(p).doc&&(u=l.mapping.maps[l.mapping.maps.length-1],c.push(new Xo(u,null,null,c.length+d.length))),o--,u&&r.appendMap(u,o)}else l.maybeStep(e.step);return e.selection?(a=r?e.selection.map(r.slice(o)):e.selection,s=new Go(n.items.slice(0,i).append(d.reverse().concat(c)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:a}},Go.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,a=this.items,s=!r&&a.length?a.get(a.length-1):null,l=0;lJo&&(h=m,(p=a).forEach((function(e,t){if(e.selection&&0==h--)return f=t,!1})),a=p.slice(f),i-=m),new Go(a.append(o),i)},Go.prototype.remapping=function(e,t){var n=new Ee;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},Go.prototype.addMaps=function(e){return 0==this.eventCount?this:new Go(this.items.append(e.map((function(e){return new Xo(e)}))),this.eventCount)},Go.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),r);var s=t;this.items.forEach((function(t){var r=o.getMirror(--s);if(null!=r){i=Math.min(i,r);var l=o.maps[r];if(t.step){var c=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(o.slice(s+1,r));d&&a++,n.push(new Xo(l,c,d))}else n.push(new Xo(l))}}),r);for(var l=[],c=t;c500&&(u=u.compress(this.items.length-n.length)),u},Go.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Go.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((function(i,a){if(a>=e)r.push(i),i.selection&&o++;else if(i.step){var s=i.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var c=i.selection&&i.selection.map(t.slice(n));c&&o++;var d,u=new Xo(l.invert(),s,c),p=r.length-1;(d=r.length&&r[p].merge(u))?r[p]=d:r.push(u)}}else i.map&&n--}),this.items.length,0),new Go(Zo.from(r.reverse()),o)},Go.empty=new Go(Zo.empty,0);var Xo=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};Xo.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new Xo(t.getMap().invert(),t,this.selection)}};var Yo=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},Jo=20;function Qo(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function ei(e,t){if(!e)return null;for(var n=[],r=0;r({...e,[t]:di[t][this.size]})),{}),this.metrics.emPerEx=di.xHeight[this.size]/di.quad[this.size]}sup(){return Li[[4,5,4,5,6,7,6,7][this.id]]}sub(){return Li[[5,5,5,5,7,7,7,7][this.id]]}fracNum(){return Li[[2,3,4,5,6,7,6,7][this.id]]}fracDen(){return Li[[3,3,5,5,7,7,7,7][this.id]]}cramp(){return Li[[1,1,3,3,5,5,7,7][this.id]]}cls(){return["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"][this.size]}adjustTo(e){let t=[["","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-textstyle displaystyle textstyle","","reset-textstyle scriptstyle","reset-textstyle scriptscriptstyle"],["reset-scriptstyle textstyle displaystyle","reset-scriptstyle textstyle","","reset-scriptstyle scriptscriptstyle"],["reset-scriptscriptstyle textstyle displaystyle","reset-scriptscriptstyle textstyle","reset-scriptscriptstyle scriptstyle",""]][this.size][e.size];return t.length>0&&(t=" "+t),t}isTight(){return this.size>=2}}const Li={0:new Ci(0,0,1,!1),1:new Ci(1,0,1,!0),2:new Ci(2,1,1,!1),3:new Ci(3,1,1,!0),4:new Ci(4,2,.7,!1),5:new Ci(5,2,.7,!0),6:new Ci(6,3,.5,!1),7:new Ci(7,3,.5,!0)};Li.displaystyle=Li[0],Li.textstyle=Li[2],Li.scriptstyle=Li[4],Li.scriptscriptstyle=Li[6];class Oi{constructor(e){var t,n,r,o,i,a;this.macros=null!==(t=e.macros)&&void 0!==t?t:{},this.atomIdsSettings=e.atomIdsSettings,this.mathstyle=null!==(n=e.mathstyle)&&void 0!==n?n:Li.displaystyle,this.letterShapeStyle=null!==(r=e.letterShapeStyle)&&void 0!==r?r:"tex",this.size=null!==(o=e.size)&&void 0!==o?o:"size5",this.parentMathstyle=null!==(i=e.parentMathstyle)&&void 0!==i?i:this.mathstyle,this.parentSize=null!==(a=e.parentSize)&&void 0!==a?a:this.size,this.opacity=e.opacity,this.smartFence=e.smartFence}clone(e={}){const t=new Oi(this);return void 0!==e&&(Object.assign(t,e),e.mathstyle?(t.parentMathstyle=this.mathstyle,t.parentSize=this.size,"string"==typeof e.mathstyle&&(t.mathstyle=Li[e.mathstyle])):t.mathstyle=this.mathstyle),t}setMathstyle(e){e&&"auto"!==e&&(this.mathstyle=Li[e])}cramp(){return this.clone({mathstyle:this.mathstyle.cramp()})}sup(){return this.clone({mathstyle:this.mathstyle.sup()})}sub(){return this.clone({mathstyle:this.mathstyle.sub()})}}const Ti={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Ai={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34]},Di={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",widetilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",widetilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",widetilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",widetilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};function Pi(e,t){const n=[];let r,o=[];return e.forEach((e=>{if("first"!==e.type){let i;"variant"===t?(i=e.variant,e.variantStyle&&"up"!==e.variantStyle&&(i+="-"+e.variantStyle)):i=e[t],i!==r?(o.length>0&&n.push(o),o=[e],r=i):o.push(e)}})),o.length>0&&n.push(o),n}const Ii={};function Ni(e,t){Ii[e]={...t}}const Ri=["","mord","mbin","mop","mrel","mopen","mclose","mpunct","minner","spacing","first","command","composition","error","placeholder","textord","none"];function Bi(e){return Ri.includes(e)}const ji={"mord+mop":3,"mord+mbin":4,"mord+mrel":5,"mord+minner":3,"mop+mord":3,"mop+mop":3,"mop+mbin":5,"mop+minner":3,"mbin+mord":4,"mbin+mop":4,"mbin+mopen":4,"mbin+minner":4,"mrel+mord":5,"mrel+mop":5,"mrel+mopen":5,"mrel+minner":5,"mclose+mop":3,"mclose+mbin":4,"mclose+mrel":5,"mclose+minner":3,"mpunct+mord":3,"mpunct+mop":3,"mpunct+mbin":4,"mpunct+mrel":5,"mpunct+mopen":3,"mpunct+mpunct":3,"mpunct+minner":3},$i={"mord+mop":3,"mop+mord":3,"mop+mop":3,"mclose+mop":3,"minner+mop":3};function Ki(e){if("string"==typeof e)return e;if("number"==typeof e)return Number(Math.ceil(100*e)/100).toString();if(void 0===e)return"";if(si(e)){let t="";for(const n of e)t+=Ki(n);return t}return console.error("Span.toStringUnexpected argument type"),""}class qi{constructor(e,t="",n=""){this.classes=t,si(e)?this.children=[].concat(...e):"string"==typeof e?this.body=e:e&&"object"==typeof e&&(this.children=[e]),this.type=n,this.style=null,this.updateDimensions()}updateDimensions(){let e=0,t=0,n=1;this.children?this.children.forEach((r=>{r.height>e&&(e=r.height),r.depth>t&&(t=r.depth),r.maxFontSize>n&&(n=r.maxFontSize)})):"string"==typeof this.body&&(e=xi,t=0),this.height=e,this.depth=t,this.maxFontSize=n}selected(e){e&&!/ML__selected/.test(this.classes)&&(this.classes.length>0&&(this.classes+=" "),this.classes+="ML__selected"),!e&&/ML__selected/.test(this.classes)&&(this.classes=this.classes.replace("ML__selected","")),this.children&&this.children.forEach((t=>t.selected(e)))}applyStyle(e){if(!e)return;if(e.color&&("none"!==e.color?this.setStyle("color",e.color):this.setStyle("color","")),e.backgroundColor&&("none"!==e.backgroundColor?this.setStyle("background-color",e.backgroundColor):this.setStyle("background-color","")),e.cssClass&&(this.classes+=" "+e.cssClass),!this.body)return;console.assert("string"==typeof this.body);const t=function(e,t){var n;return(null===(n=Ii[t.mode])||void 0===n?void 0:n.applyStyle)?Ii[t.mode].applyStyle(e,t):""}(this,e);if(this.body&&t){this.maxFontSize={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49}[e.fontSize]||1,this.height=0,this.depth=0,this.skew=0,this.italic=0;for(let e=0;e0&&(this.style||(this.style={}),this.style[e]=n)}setTop(e){e&&0!==e&&(this.style||(this.style={}),this.style.top=Ki(e)+"em",this.height-=e,this.depth+=e)}setLeft(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-left"]=Ki(e)+"em")}setRight(e){e&&0!==e&&(this.style||(this.style={}),this.style["margin-right"]=Ki(e)+"em")}setWidth(e){e&&0!==e&&(this.style||(this.style={}),this.style.width=Ki(e)+"em")}toMarkup(e=1,t=1){var n,r,o,i,a;let s="",l=this.body||"";if(this.children){let e="none";for(let o=0;o`${e}="${this.attributes[e]}"`)).join(" "));const t=this.classes.split(" ");t.push(null!==(o={command:"ML__command",placeholder:"ML__placeholder",error:"ML__error"}[this.type])&&void 0!==o?o:""),this.caret&&"command"===this.type&&t.push("ML__command-caret");let n="";if(n=t.length>1?t.filter(((e,t,n)=>e.length>0&&n.indexOf(e)===t)).join(" "):t[0],n.length>0&&(s+=` class="${n}"`),e&&((null===(i=this.style)||void 0===i?void 0:i["margin-left"])?this.style["margin-left"]=Ki(parseFloat(this.style["margin-left"])+e/18)+"em":(this.style||(this.style={}),this.style["margin-left"]=Ki(e/18)+"em")),this.style){let e="";const t=/ML__selected/.test(this.classes);for(const n in this.style)Object.prototype.hasOwnProperty.call(this.style,n)&&("background-color"===n&&t||(e+=n+":"+this.style[n]+";"));e.length>0&&(s+=' style="'+e+'"')}s+=">",this.svgBody?s+=function(e){if(Ai[e]){const t=Ai[e][2];return``}const[t,n,r,o]=Ti[e];let i,a;const s=r/1e3;3===t.length?(i=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],a=["xMinYMin","xMidYMin","xMaxYMin"]):2===t.length?(i=["slice-1-of-2","slice-2-of-2"],a=["xMinYMin","xMaxYMin"]):(i=["slice-1-of-1"],a=[o]);const l=t.map(((e,t)=>``)).join("");return`${l}`}(this.svgBody):this.svgOverlay?(s+='",s+=""):s+=l,s+=""}else s="";return this.caret&&"command"!==this.type&&("text"===this.caret?s+='':s+=''),s}tryCoalesceWith(e){if(this.type!==e.type)return!1;if("error"===this.type||"placeholder"===this.type||"command"===this.type)return!1;if(this.svgBody||!this.body)return!1;if(e.svgBody||!e.body)return!1;const t=this.children&&this.children.length>0,n=e.children&&e.children.length>0;if(t||n)return!1;if((this.style?this.style.length:0)!==(e.style?e.style.length:0))return!1;const r=this.classes.trim().replace(/\s+/g," ").split(" "),o=e.classes.trim().replace(/\s+/g," ").split(" ");if(r.length!==o.length)return!1;r.sort(),o.sort();for(let e=0;e=e.length)return"none";const s=null!==(r=null===(n=e[t-1])||void 0===n?void 0:n.type)&&void 0!==r?r:"none",l=null!==(i=null===(o=e[t+1])||void 0===o?void 0:o.type)&&void 0!==i?i:"none";let c=null!==(a=e[t].type)&&void 0!==a?a:"none";return"first"===c?"none":"textord"===c?"mord":("mbin"===c&&(/first|none|mrel|mpunct|mopen|mbin|mop/.test(s)||/none|mrel|mpunct|mclose/.test(l))&&(c="mord"),c)}function Hi(e){if(!e||0===e.length)return[];e[0].children=Hi(e[0].children);const t=[e[0]];for(let n=1;nMath.max(e,t.height)),0):e.height:0}function Vi(e){return e?si(e)?e.reduce(((e,t)=>Math.max(e,t.depth)),0):e.depth:0}function Ui(e){return e?si(e)?e[e.length-1].italic:e.italic:0}function Zi(e,t="",n=""){if(si(e)){const r=e.filter((e=>Boolean(e)));return 1===r.length?new qi(r[0],t,n):new qi(r,t,n)}return new qi(e,t,n)}function Gi(e,t,n="",r=""){const o=new qi(t,n,r),i=Si(t,e);return o.height=i.height,o.depth=i.depth,o.skew=i.skew,o.italic=i.italic,o.setRight(o.italic),o}function Xi(e,t="",n=""){const r=Zi("","ML__strut");let o,i;return r.setStyle("height",Wi(e),"em"),0!==Vi(e)&&(o=Zi("","ML__strut--bottom"),o.setStyle("height",Wi(e)+Vi(e),"em"),o.setStyle("vertical-align",-Vi(e),"em")),i=si(e)?[r,o,...e]:[r,o,e],Zi(i,t,n)}function Yi(e,t,n,r,o){o=o||"";const i=Ji(t,(o+=" style-wrap ")+n.adjustTo(r));i.type=e;const a=r.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=r.sizeMultiplier,i}function Ji(e,t="",n=""){const r=new qi(e,t,n);let o=1;return o=e instanceof qi?e.maxFontSize:e.reduce(((e,t)=>Math.max(e,t.maxFontSize)),o),r.height*=o,r.depth*=o,r}function Qi(e,t,n="shift",r=0){let o=0,i=0;n=n||"shift";for(let e=0;e0?"em":""),r.attributes={"aria-hidden":"true"}),"size5"!==e.size?new qi(r,"fontsize-ensurer reset-"+e.size+" size5"):0!==n?r:null}(e,a),l=[];i=o;for(const e of t)if("number"==typeof e)i+=e;else if(e instanceof qi){const t=Zi([s,e]);t.setTop(-e.depth-i),l.push(t),i+=e.height+e.depth}const c=Zi(l,"vlist");return c.depth=Math.max(o,Vi(c)||0),c.height=Math.max(-i,Wi(c)||0),c}function ea(e){const t=new qi(null);return t.svgBody=e,t.height=function(e){return Ti[e]?Ti[e][2]/1e3:Ai[e][2]}(e)/2,t.depth=t.height,t}const ta={},na={"<":"<",">":">",o:"o","&":"\\&","{":"\\{","}":"\\}","[":"\\lbrack","]":"\\rbrack",":":"\\colon"," ":"~","¬":"\\neg","·":"\\cdot","¼":"\\frac{1}{4}","½":"\\frac{1}{2}","¾":"\\frac{3}{4}","⁰":"^{0}","ⁱ":"^{i}","¹":"^{1}","²":"^{2}","³":"^{3}","†":"\\dagger","‡":"\\ddagger","…":"\\ldots","⁴":"^{4}","⁵":"^{5}","⁶":"^{6}","⁷":"^{7}","⁸":"^{8}","⁹":"^{9}","⁺":"^{+}","⁻":"^{-}","⁼":"^{=}","ⁿ":"^{n}","₀":"_{0}","₁":"_{1}","₂":"_{2}","₃":"_{3}","₄":"_{4}","₅":"_{5}","₆":"_{6}","₇":"_{7}","₈":"_{8}","₉":"_{9}","₊":"_{+}","₋":"_{-}","₌":"_{=}","ₐ":"_{a}","ₑ":"_{e}","ₒ":"_{o}","ₓ":"_{x}","′":"\\prime","'":"\\prime","←":"\\gets","→":"\\to","△":"\\triangle","▽":"\\triangledown","∋":"\\owns","∗":"\\ast","∣":"\\vert","∥":"\\Vert","∧":"\\land","∨":"\\lor","⋅":"\\cdot","⋈":"\\bowtie","≠":"\\ne","≤":"\\le","≥":"\\ge","⊥":"\\bot","⟷":"\\biconditional","⟸":"\\impliedby","⟹":"\\implies","ℂ":"\\C","ℕ":"\\N","ℙ":"\\P","ℚ":"\\Q","ℝ":"\\R","ℤ":"\\Z"},ra={},oa={},ia={iff:"\\;⟺\\;",nicefrac:"^{#1}\\!\\!/\\!_{#2}",bra:"\\mathinner{\\langle{#1}|}",ket:"\\mathinner{|{#1}\\rangle}",braket:"\\mathinner{\\langle{#1}\\rangle}",set:"\\mathinner{\\lbrace #1 \\rbrace}",Bra:"\\left\\langle #1\\right|",Ket:"\\left|#1\\right\\rangle",Braket:"\\left\\langle{#1}\\right\\rangle",Set:"\\left\\lbrace #1 \\right\\rbrace",rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}"},aa={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},sa={"\\#":"#","\\&":"&","\\$":"$","\\%":"%","\\_":"_","\\euro":"€","\\maltese":"✠","\\{":"{","\\}":"}","\\nobreakspace":" ","\\ldots":"…","\\textellipsis":"…","\\backslash":"\\","`":"‘","'":"’","``":"“","''":"”","\\degree":"°","\\textasciicircum":"^","\\textasciitilde":"~","\\textasteriskcentered":"*","\\textbackslash":"\\","\\textbraceleft":"{","\\textbraceright":"}","\\textbullet":"•","\\textdollar":"$","\\textsterling":"£","\\textdagger":"†","\\textdaggerdbl":"‡","–":"–","—":"—","‘":"‘","’":"’","“":"“","”":"”",'"':"”","\\ss":"ß","\\ae":"æ","\\oe":"œ","\\AE":"Æ","\\OE":"Œ","\\O":"Ø","\\i":"ı","\\j":"ȷ","\\aa":"å","\\AA":"Å"},la=/[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,ca="undefined"!=typeof navigator&&/firefox|edge|Trident/i.test(navigator.userAgent)?/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("\\p{Letter}","u"),da="undefined"!=typeof navigator&&/firefox|edge|Trident/i.test(navigator.userAgent)?/[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/:new RegExp("[0-9\\p{Letter}]","u");function ua(e,t,n="mord",r=""){ta[e]={type:n,variant:r,value:t},na[t]||r||(na[t]=e),sa[e]=t}function pa(e,t){for(let n=e;n<=t;n++){const e=String.fromCodePoint(n);ua(e,e)}}function ha(e,t){if("math"===e)return na[t]||t;if("text"===e){let e=Object.keys(sa).find((e=>sa[e]===t));if(!e){const n=t.codePointAt(0).toString(16);e="^".repeat(n.length)+n}return e}return t}const fa={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},ma=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function ga(e,t,n){if(!/[A-Za-z0-9]/.test(e))return e;if(!t&&!n)return e;const r=e.codePointAt(0);for(let e=0;e=ma[e].offset&&r120831)&&(e<8448||e>8527))return{char:String.fromCodePoint(e)};for(const n in fa)if(Object.prototype.hasOwnProperty.call(fa,n)&&fa[n]===e){e=null!==(t=n.codePointAt(0))&&void 0!==t?t:0;break}for(let t=0;t=ma[t].start&&e=1;)r.params.push({isOptional:!1,type:"math"}),o-=1}}}else"math"===t?r=ta[e]:sa[e]?r={value:sa[e]}:"text"===t&&(r={value:e});return!r||"mord"!==r.type||"f"!==r.value&&"g"!==r.value&&"h"!==r.value||(r.isFunction=!0),r}function _a(e){if(e.length<=1)return[];const t=[];for(const n in ra)Object.prototype.hasOwnProperty.call(ra,n)&&n.startsWith(e)&&!ra[n].infix&&t.push({match:n,frequency:ra[n].frequency});for(const n in ta)Object.prototype.hasOwnProperty.call(ta,n)&&n.startsWith(e)&&t.push({match:n,frequency:ta[n].frequency});return t.sort(((e,t)=>e.frequency===t.frequency?e.match.length-t.match.length:(t.frequency||0)-(e.frequency||0))),t}function Ma(e){let t="auto";const n=e.match(/:([^=]+)/);return n&&(t=n[1].trim()),t}function Sa(e){if(!e)return[];let t=[],n=e.split("]");if("["===n[0].charAt(0)){t.push({isOptional:!0,type:Ma(n[0].slice(1))});for(let e=1;e<=n.length;e++)t=t.concat(Sa(n[e]))}else if(n=e.split("}"),"{"===n[0].charAt(0)){t.push({isOptional:!1,type:Ma(n[0].slice(1))});for(let e=1;e<=n.length;e++)t=t.concat(Sa(n[e]))}return t}function Ea(e){let t="",n=!0;return e.forEach((e=>{"string"==typeof e.body?t+=e.body:n=!1})),n?t:""}function za(e,t,n,r=!1){"string"==typeof e&&(e=[e]);const o={tabular:r,params:Sa(t),parser:n};for(const t of e)oa[t]=o}function Ca(e,t,n){za(e,t,n,!0)}function La(e,t,n,r,o){"string"==typeof e&&(e=[e]),n||(n={});const i={params:Sa(t),mode:n.mode,infix:Boolean(n.infix),parse:r,emit:o};e.forEach((e=>{ra["\\"+e]=i}))}const Oa={acute:"ˊ",grave:"ˋ",dot:"˙",ddot:"¨",mathring:"˚",tilde:"~",bar:"ˉ",breve:"˘",check:"ˇ",hat:"^",vec:"⃗"};La(Object.keys(Oa),"{body:auto}",null,(function(e,t){return{type:"accent",accent:Oa[e.slice(1)],limits:"accent",skipBoundary:!0,body:t[0]}})),La(["widehat","widecheck","widetilde"],"{body:auto}",null,((e,t)=>{const n=Ea(t[0]);return{type:"accent",svgAccent:e.slice(1)+(n.length>5?"4":["1","1","2","2","3","3"][n.length]),limits:"accent",skipBoundary:!0,body:t[0]}})),La("utilde","{body:auto}",null,((e,t)=>{const n=Ea(t[0]),r="widetilde"+(n.length>5?"4":["1","1","2","2","3","3"][n.length]);return{type:"overunder",body:t[0],svgBelow:r,skipBoundary:!0}}),((e,t,n,r)=>`\\utilde{${r(n,n.body)}}`)),La("^","{:string}",{},((e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"}[t[0]]||"^"}))),La("`","{:string}",{},((e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"}[t[0]]||"`"}))),La("'","{:string}",{},(function(e,t){return{type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{a:"á",e:"é",i:"í",o:"ó",u:"ú",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú"}[t[0]]||"^"}})),La("~","{:string}",{},((e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{n:"ñ",N:"Ñ",a:"ã",o:"õ",A:"Ã",O:"Õ"}[t[0]]||"´"}))),La("c","{:string}",{},((e,t)=>({type:"mord",limits:"nolimits",isSymbol:!0,isFunction:!1,body:t[0]&&{c:"ç",C:"Ç"}[t[0]]||""}))),La("enclose","{notation:string}[style:string]{body:auto}",null,((e,t)=>{var n;const r={type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"auto",captureSelection:!0,body:t[2]};if(t[1]){const e=t[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const t of e){const e=t.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(e)r.strokeWidth=zi(e[1],"px"),isFinite(r.strokeWidth)||(r.strokeWidth=1),r.strokeStyle=e[2],r.strokeColor=e[3];else{const e=t.match(/\s*([a-z]*)\s*=\s*"(.*)"/);e&&("mathbackground"===e[1]?r.backgroundcolor=e[2]:"mathcolor"===e[1]?r.strokeColor=e[2]:"padding"===e[1]?r.padding=zi(e[2],"px"):"shadow"===e[1]&&(r.shadow=e[2]))}}"dashed"===r.strokeStyle?r.svgStrokeStyle="5,5":"dotted"===r.strokeStyle&&(r.svgStrokeStyle="1,5")}return r.borderStyle=r.strokeWidth+"px "+r.strokeStyle+" "+r.strokeColor,r.notation={},(null!==(n=t[0])&&void 0!==n?n:"").split(/[, ]/).filter((e=>e.length>0)).forEach((e=>{r.notation[e.toLowerCase()]=!0})),r.notation.updiagonalarrow&&(r.notation.updiagonalstrike=!1),r.notation.box&&(r.notation.left=!1,r.notation.right=!1,r.notation.bottom=!1,r.notation.top=!1),r})),La("cancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0},body:t[0]}})),La("bcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{downdiagonalstrike:!0},body:t[0]}})),La("xcancel","{body:auto}",null,(function(e,t){return{type:"enclose",strokeColor:"currentColor",strokeWidth:1,strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"auto",notation:{updiagonalstrike:!0,downdiagonalstrike:!0},body:t[0]}})),za("math","",(()=>({mathstyle:"textstyle"}))),za("displaymath","",(function(){return{mathstyle:"displaystyle"}})),Ca("array","{columns:colspec}",((e,t)=>({colFormat:t[0],mathstyle:"textstyle"}))),Ca(["equation","equation","subequations"],"",(()=>({colFormat:[{align:"c"}]}))),Ca("multline","",(function(){return{colFormat:[{align:"m"}]}})),Ca(["align","align*","aligned","eqnarray"],"",((e,t,n)=>{let r=0;for(const e of n)r=Math.max(r,e.length);const o=[{gap:0},{align:"r"},{gap:0},{align:"l"}];let i=2;for(;i({colFormat:[{align:"r"},{align:"l"}]}))),Ca(["gather","gathered"],"",(()=>({colFormat:[{gap:.25},{align:"c"},{gap:0}],jot:.3}))),Ca(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","smallmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*","smallmatrix*"],"[columns:colspec]",((e,t)=>{var n;const r={mathstyle:"textstyle"};switch(e){case"pmatrix":case"pmatrix*":r.leftDelim="(",r.rightDelim=")";break;case"bmatrix":case"bmatrix*":r.leftDelim="[",r.rightDelim="]";break;case"Bmatrix":case"Bmatrix*":r.leftDelim="\\lbrace",r.rightDelim="\\rbrace";break;case"vmatrix":case"vmatrix*":r.leftDelim="\\vert",r.rightDelim="\\vert";break;case"Vmatrix":case"Vmatrix*":r.leftDelim="\\Vert",r.rightDelim="\\Vert";break;case"smallmatrix":case"smallmatrix*":r.mathstyle="scriptstyle";break;case"matrix":case"matrix*":r.leftDelim=".",r.rightDelim="."}return r.colFormat=null!==(n=t[0])&&void 0!==n?n:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}],r})),Ca("cases","",(()=>({arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",colFormat:[{align:"l"},{gap:1},{align:"l"}]}))),za("center","",(function(){return{colFormat:[{align:"c"}]}})),La(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overbrace","overlinesegment","overgroup"],"{:auto}",null,((e,t)=>({type:"overunder",body:t[0],svgAbove:e.slice(1),skipBoundary:!0,limits:"overunder"})),((e,t,n,r)=>`${e}{${r(n,n.body)}}`)),La(["underrightarrow","underleftarrow","underleftrightarrow","underbrace","underlinesegment","undergroup"],"{:auto}",null,((e,t)=>({type:"overunder",body:t[0],svgBelow:e.slice(1),skipBoundary:!0,limits:"overunder"})),((e,t,n,r)=>`${e}{${r(n,n.body)}}`)),La(["xrightarrow","xleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","xLeftrightarrow","xrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xrightleftarrows","xrightequilibrium","xleftequilibrium"],"[:auto]{:auto}",null,((e,t)=>{let n=t[1];return 0===(null==n?void 0:n.length)&&(n=null),{type:"overunder",mathtype:"mrel",svgBody:e.slice(1),overscript:n,underscript:t[0]}}),((e,t,n,r)=>e+(void 0!==n.underscript?`[${r(n,n.underscript)}]`:"")+`{${r(n,n.overscript)}}`)),La(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","coth","ctg","cth","cotg","csc","cosec","deg","dim","exp","hom","inf","ker","lg","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main",variantStyle:"up"}})),La(["liminf","limsup"],"",null,(e=>({type:"mop",limits:"limits",isSymbol:!1,body:{"\\liminf":"lim inf","\\limsup":"lim sup"}[e],variant:"main"}))),La(["lim","mod"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,body:e.slice(1),variant:"main"}})),La(["det","max","min"],"",null,(function(e){return{type:"mop",limits:"limits",isSymbol:!1,isFunction:!0,body:e.slice(1),variant:"main"}})),La("sqrt","[index:auto]{radicand:auto}",null,((e,t)=>({type:"surd",body:t[1],index:t[0]})),((e,t,n,r)=>{let o="";return void 0!==n.index&&(o+=`[${r(n,n.index)}]`),o+=`{${r(n,n.body)}}`,e+o})),La(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{numerator}{denominator}",null,((e,t)=>{const n={type:"genfrac",numer:t[0],denom:t[1],mathstyle:"auto"};switch(e){case"\\dfrac":case"\\frac":case"\\tfrac":case"\\cfrac":n.hasBarLine=!0;break;case"\\\\atopfrac":n.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n.hasBarLine=!1,n.leftDelim="(",n.rightDelim=")"}switch(e){case"\\dfrac":case"\\dbinom":n.mathstyle="displaystyle";break;case"\\tfrac":case"\\tbinom":n.mathstyle="textstyle"}return"\\cfrac"===e&&(n.continuousFraction=!0),n}),((e,t,n,r)=>`${e}{${r(n,n.numer)}}{${r(n,n.denom)}}`)),La(["over","atop","choose"],"",{infix:!0},((e,t)=>{const n=t[0],r=t[1];let o=!1,i=null,a=null;switch(e){case"\\atop":break;case"\\over":o=!0;break;case"\\choose":o=!1,i="(",a=")";break;default:throw new Error("Unrecognized genfrac command")}return{type:"genfrac",numer:n,denom:r,hasBarLine:o,leftDelim:i,rightDelim:a,mathstyle:"auto"}}),((e,t,n,r)=>`{${r(n,n.numer)}${e} ${r(n,n.denom)}}`)),La("pdiff","{numerator}{denominator}",null,((e,t)=>({type:"genfrac",numer:t[0],denom:t[1],numerPrefix:"∂",denomPrefix:"∂",hasBarLine:!0,leftDelim:null,rightDelim:null,mathstyle:"auto"})),((e,t,n,r)=>`${e}{${r(n,n.numer)}}{${r(n,n.denom)}}`)),La(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","smallint","intop"],"",null,(e=>({type:"mop",limits:"auto",isSymbol:!0,variant:"main",body:{coprod:"∐",bigvee:"⋁",bigwedge:"⋀",biguplus:"⨄",bigcap:"⋂",bigcup:"⋃",intop:"∫",prod:"∏",sum:"∑",bigotimes:"⨂",bigoplus:"⨁",bigodot:"⨀",bigsqcup:"⨆",smallint:"∫"}[e.slice(1)]})));const Ta={int:"∫",iint:"∬",iiint:"∭",oint:"∮",oiint:"∯",oiiint:"∰",intclockwise:"∱",varointclockwise:"∲",ointctrclockwise:"∳",intctrclockwise:"⨑",sqcup:"⊔",sqcap:"⊓",uplus:"⊎",wr:"≀",amalg:"⨿",Cap:"⋒",Cup:"⋓",doublecap:"⋒",doublecup:"⋓"};La(Object.keys(Ta),"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!0,body:Ta[e.slice(1)],variant:{"⋒":"ams","⋓":"ams"}[Ta[e.slice(1)]]}})),La(["Re","Im"],"",null,(function(e){return{type:"mop",limits:"nolimits",isSymbol:!1,isFunction:!0,body:{"\\Re":"ℜ","\\Im":"ℑ"}[e],variant:"fraktur"}})),La("middle","{:delim}",null,(function(e,t){return{type:"delim",delim:t[0]}}));const Aa={m0:"#3f3d99",m1:"#993d71",m2:"#998b3d",m3:"#3d9956",m4:"#3d5a99",m5:"#993d90",m6:"#996d3d",m7:"#43993d",m8:"#3d7999",m9:"#843d99"},Da=["#d35d60","#7293cb","#e1974d","#84bb5d","#9066a7","#aD6a58","#f5a4ce","#fff590","#212121","#818787","#d4d5d2","#ffffff"],Pa=["#cc2428","#3769b1","#da7e30","#409852","#6b4c9a","#922426","#e7298a","#ffe907","#000000","#525055","#adafaa","#ffffff"],Ia={apricot:"#FBB982",aquamarine:"#00B5BE",bittersweet:"#C04F17",black:"#221E1F",blue:"#2D2F92",bluegreen:"#00B3B8",blueviolet:"#473992",brickred:"#B6321C",brown:"#792500",burntorange:"#F7921D",cadetblue:"#74729A",carnationpink:"#F282B4",cerulean:"#00A2E3",cornflowerblue:"#41B0E4",cyan:"#00AEEF",dandelion:"#FDBC42",darkorchid:"#A4538A",emerald:"#00A99D",forestgreen:"#009B55",fuchsia:"#8C368C",goldenrod:"#FFDF42",gray:"#949698",green:"#00A64F",greenyellow:"#DFE674",junglegreen:"#00A99A",lavender:"#F49EC4",limegreen:"#8DC73E",magenta:"#EC008C",mahogany:"#A9341F",maroon:"#AF3235",melon:"#F89E7B",midnightblue:"#006795",mulberry:"#A93C93",navyblue:"#006EB8",olivegreen:"#3C8031",orange:"#F58137",orangered:"#ED135A",orchid:"#AF72B0",peach:"#F7965A",periwinkle:"#7977B8",pinegreen:"#008B72",plum:"#92268F",processblue:"#00B0F0",purple:"#99479B",rawsienna:"#974006",red:"#ED1B23",redorange:"#F26035",redviolet:"#A1246B",rhodamine:"#EF559F",royalblue:"#0071BC",royalpurple:"#613F99",rubinered:"#ED017D",salmon:"#F69289",seagreen:"#3FBC9D",sepia:"#671800",skyblue:"#46C5DD",springgreen:"#C6DC67",tan:"#DA9D76",tealblue:"#00AEB3",thistle:"#D883B7",turquoise:"#00B4CE",violet:"#58429B",violetred:"#EF58A0",white:"#FFFFFF",wildstrawberry:"#EE2967",yellow:"#FFF200",yellowgreen:"#98CC70",yelloworange:"#FAA21A"};function Na(e){var t;const n=e.toLowerCase().split("!");let r,o,i,a=255,s=255,l=255,c=-1;const d=n.length>0&&"-"===n[0].charAt(0);d&&(n[0]=n[0].slice(1));for(let e=0;e=0&&(a=(1-c)*a+c*r,s=(1-c)*s+c*o,l=(1-c)*l+c*i,c=-1),e+1=0&&(a=c*a+(1-c)*r,s=c*s+(1-c)*o,l=c*l+(1-c)*i),d&&(a=255-a,s=255-s,l=255-l),"#"+("00"+Math.round(a).toString(16)).slice(-2)+("00"+Math.round(s).toString(16)).slice(-2)+("00"+Math.round(l).toString(16)).slice(-2)}function Ra(e){let t=e.toUpperCase();for(const e in Ia)if(Ia[e]===t){t=e;break}for(const e in Aa)if(Aa[e]===t){t=e;break}return t}La("ensuremath","{:math}",{},((e,t)=>({type:"group",mode:"math",body:t[0],skipBoundary:!0,latexOpen:"\\ensuremath{",latexClose:"}"})),((e,t,n,r)=>r(n,n.body))),La("color","{:color}",{},((e,t)=>({color:t[0]}))),La("textcolor","{:color}{content:auto*}",{},((e,t)=>({color:t[0]}))),La("boxed","{content:math}",null,((e,t)=>({type:"box",framecolor:"black",skipBoundary:!0,body:t[0]}))),La("colorbox","{background-color:string}{content:auto}",{},((e,t)=>({type:"box",backgroundcolor:Na(t[0]),skipBoundary:!0,body:t[1],verbatimBackgroundcolor:t[0]})),((e,t,n,r)=>`${e}{${n.verbatimBackgroundcolor||Ra(n.backgroundcolor)}}{${r(n,n.body)}}`)),La("fcolorbox","{frame-color:string}{background-color:string}{content:auto}",{},((e,t)=>({type:"box",framecolor:Na(t[0]),backgroundcolor:Na(t[1]),skipBoundary:!0,body:t[2],verbatimBackgroundcolor:t[1],verbatimFramecolor:t[0]})),((e,t,n,r)=>`${e}{${n.verbatimFramecolor||Ra(n.framecolor)}{${n.verbatimBackgroundcolor||Ra(n.backgroundcolor)}}{${r(n,n.body)}}`)),La("bbox","[:bbox]{body:auto}",{},((e,t)=>{if(t[0]){const e=t[0];return{type:"box",padding:e.padding,border:e.border,backgroundcolor:e.backgroundcolor,skipBoundary:!0,body:t[1]}}return{type:"box",skipBoundary:!0,body:t[1]}}),((e,t,n,r)=>{let o=e;if(isFinite(n.padding)||void 0!==n.border||void 0!==n.backgroundcolor){const e=[];isFinite(n.padding)&&e.push(Math.floor(100*n.padding)/100+"em"),n.border&&e.push("border:"+n.border),n.backgroundcolor&&e.push(Ra(n.backgroundcolor)),o+=`[${e.join(",")}]`}return o+`{${r(n,n.body)}}`})),La(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"",{},((e,t)=>({mathstyle:e.slice(1)}))),La(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{mode:"text"},((e,t)=>({fontSize:{tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[e.slice(1)]}))),La("fontseries","{:string}",{mode:"text"},((e,t)=>({fontSeries:t[0]}))),La("fontshape","{:string}",{mode:"text"},((e,t)=>({fontShape:t[0]}))),La("fontfamily","{:string}",{mode:"text"},((e,t)=>({fontFamily:t[0]}))),La("selectfont","",{mode:"text"},((e,t)=>({}))),La("bf","",{},((e,t)=>({fontSeries:"b",fontShape:"n",fontFamily:"cmr"}))),La(["boldsymbol","bm"],"{:math*}",{},((e,t)=>({mode:"math",cssClass:"ML__boldsymbol"}))),La("bold","{:math*}",{},((e,t)=>({mode:"math",variantStyle:"bold"}))),La("bfseries","",{mode:"text"},((e,t)=>({fontSeries:"b"}))),La("mdseries","",{mode:"text"},((e,t)=>({fontSeries:"m"}))),La("upshape","",{mode:"text"},((e,t)=>({fontShape:"n"}))),La("slshape","",{mode:"text"},((e,t)=>({fontShape:"sl"}))),La("scshape","",{mode:"text"},((e,t)=>({fontShape:"sc"}))),La("textbf","{:text*}",{},((e,t)=>({mode:"text",fontSeries:"b"}))),La("textmd","{:text*}",{},((e,t)=>({mode:"text",fontSeries:"m"}))),La("textup","{:text*}",{},((e,t)=>({mode:"text",fontShape:"n"}))),La("textnormal","{:text*}",{},((e,t)=>({mode:"text",fontShape:"n",fontSeries:"m"}))),La("textsl","{:text*}",{},((e,t)=>({mode:"text",fontShape:"sl"}))),La("textit","{:text*}",{},((e,t)=>({mode:"text",fontShape:"it"}))),La("textsc","{:text*}",{},((e,t)=>({mode:"text",fontShape:"sc"}))),La("textrm","{:text*}",{},((e,t)=>({mode:"text",fontFamily:"roman"}))),La("textsf","{:text*}",{},((e,t)=>({mode:"text",fontFamily:"sans-serif"}))),La("texttt","{:text*}",{},((e,t)=>({mode:"text",fontFamily:"monospace"}))),La("mathbf","{:math*}",{},((e,t)=>({mode:"math",variant:"normal",variantStyle:"bold"}))),La("mathit","{:math*}",{},((e,t)=>({mode:"math",variant:"normal",variantStyle:"italic"}))),La("mathbfit","{:math*}",{},((e,t)=>({mode:"math",variant:"normal",variantStyle:"bolditalic"}))),La("mathrm","{:math*}",{},((e,t)=>({mode:"math",variant:"normal",variantStyle:"up"}))),La("mathsf","{:math*}",{},((e,t)=>({mode:"math",variant:"sans-serif",variantStyle:"up"}))),La("mathtt","{:math*}",{},((e,t)=>({mode:"math",variant:"monospace",variantStyle:"up"}))),La("it","",{},((e,t)=>({fontSeries:"m",fontShape:"it",fontFamily:"cmr",variantStyle:"italic"}))),La("rmfamily","",{},((e,t)=>({fontFamily:"roman"}))),La("sffamily","",{},((e,t)=>({fontFamily:"sans-serif"}))),La("ttfamily","",{},((e,t)=>({fontFamily:"monospace"}))),La(["Bbb","mathbb"],"{:math*}",{},((e,t)=>({variant:"double-struck",variantStyle:"up"}))),La(["frak","mathfrak"],"{:math*}",{},((e,t)=>({variant:"fraktur",variantStyle:"up"}))),La("mathcal","{:math*}",{},((e,t)=>({variant:"calligraphic",variantStyle:"up"}))),La("mathscr","{:math*}",{},((e,t)=>({variant:"script",variantStyle:"up"}))),La("mbox","{:text}",null,((e,t)=>({type:"group",mode:"math",body:t[0]}))),La("text","{:text*}",null,((e,t)=>({mode:"text"}))),La("class","{name:string}{content:auto*}",null,((e,t)=>({cssClass:t[0]}))),La("cssId","{id:string}{content:auto}",null,((e,t)=>({type:"group",body:t[1],cssId:t[0]}))),La("em","",null,((e,t)=>({cssClass:"ML__emph"}))),La("emph","{:auto}",null,((e,t)=>({cssClass:"ML__emph",body:t[0],type:"group",skipBoundary:!0})));const Ba={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};function ja(e,t,n,r,o,i=""){const a=Yi(e,Gi("Size"+n+"-Regular",ba(t),"delimsizing size"+n),o.mathstyle,Li.textstyle,i);return r&&a.setTop((1-o.mathstyle.sizeMultiplier)*o.mathstyle.metrics.axisHeight),a.setStyle("color",o.color),"number"==typeof o.opacity&&a.setStyle("opacity",o.opacity),a}function $a(e,t){let n="";return"Size1-Regular"===t?n=" delim-size1":"Size4-Regular"===t&&(n=" delim-size4"),Gi(t,ba(e),"delimsizinginner"+n)}function Ka(e,t,n,r,o,i=""){let a,s,l,c;a=l=c=ba(t),s=null;let d="Size1-Regular";"\\vert"===t||"\\lvert"===t||"\\rvert"===t||"\\mvert"===t||"\\mid"===t?l=a=c="∣":"\\Vert"===t||"\\lVert"===t||"\\rVert"===t||"\\mVert"===t||"\\|"===t?l=a=c="∥":"\\uparrow"===t?l=c="⏐":"\\Uparrow"===t?l=c="‖":"\\downarrow"===t?a=l="⏐":"\\Downarrow"===t?a=l="‖":"\\updownarrow"===t?(a="↑",l="⏐",c="↓"):"\\Updownarrow"===t?(a="⇑",l="‖",c="⇓"):"["===t||"\\lbrack"===t?(a="⎡",l="⎢",c="⎣",d="Size4-Regular"):"]"===t||"\\rbrack"===t?(a="⎤",l="⎥",c="⎦",d="Size4-Regular"):"\\lfloor"===t?(l=a="⎢",c="⎣",d="Size4-Regular"):"\\lceil"===t?(a="⎡",l=c="⎢",d="Size4-Regular"):"\\rfloor"===t?(l=a="⎥",c="⎦",d="Size4-Regular"):"\\rceil"===t?(a="⎤",l=c="⎥",d="Size4-Regular"):"("===t?(a="⎛",l="⎜",c="⎝",d="Size4-Regular"):")"===t?(a="⎞",l="⎟",c="⎠",d="Size4-Regular"):"\\{"===t||"\\lbrace"===t?(a="⎧",s="⎨",c="⎩",l="⎪",d="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(a="⎫",s="⎬",c="⎭",l="⎪",d="Size4-Regular"):"\\lgroup"===t?(a="⎧",c="⎩",l="⎪",d="Size4-Regular"):"\\rgroup"===t?(a="⎫",c="⎭",l="⎪",d="Size4-Regular"):"\\lmoustache"===t?(a="⎧",c="⎭",l="⎪",d="Size4-Regular"):"\\rmoustache"===t?(a="⎫",c="⎩",l="⎪",d="Size4-Regular"):"\\surd"===t?(a="",c="⎷",l="",d="Size4-Regular"):"\\ulcorner"===t?(a="┌",l=c=" "):"\\urcorner"===t?(a="┐",l=c=" "):"\\llcorner"===t?(c="└",l=a=" "):"\\lrcorner"===t&&(a="┘",l=a=" ");const u=Si(ba(a),d),p=u.height+u.depth,h=Si(ba(l),d),f=h.height+h.depth,m=Si(ba(c),d),g=m.height+m.depth;let y=0,v=1;if(null!==s){const e=Si(ba(s),d);y=e.height+e.depth,v=2}const b=p+g+y,x=Math.ceil((n-b)/(v*f)),w=b+x*v*f;let k=o.mathstyle.metrics.axisHeight;r&&(k*=o.mathstyle.sizeMultiplier);const _=w/2-k,M=[];if(M.push($a(c,d)),null===s)for(let e=0;e{const n={type:{"\\mathop":"mop","\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[e],body:t[0],captureSelection:!0};return"\\mathop"===e&&(n.limits="limits",n.isFunction=!0),n}),((e,t,n,r)=>`${e}{${r(n,n.body)}}`)),La(["operatorname","operatorname*"],"{operator:math}",null,(function(e,t){const n={type:"mop",captureSelection:!0,body:t[0],isFunction:!0};return n.body.forEach((e=>{e.isFunction=!1,e.variant||e.variantStyle||(e.variant="main",e.variantStyle="up"),e.type="mord",e.body={"∗":"*","−":"-"}[e.body]||e.body})),"\\operatorname"===e?n.limits="nolimits":"\\operatorname*"===e&&(n.limits="limits"),n})),La("unicode","{charcode:number}",null,((e,t)=>{let n=parseInt(t[0]);return isFinite(n)||(n=10067),{type:"mord",body:String.fromCodePoint(n),codepoint:n}}),((e,t,n,r)=>`${e}{"${("000000"+n.codepoint.toString(16)).toUpperCase().substr(-6)}}`)),La("rule","[raise:dimen]{width:dimen}{thickness:dimen}",null,(function(e,t){return{type:"rule",shift:t[0],width:t[1],height:t[2]}})),La("overline","{:auto}",null,((e,t)=>({type:"line",position:"overline",skipBoundary:!0,body:t[0]}))),La("underline","{:auto}",null,((e,t)=>({type:"line",position:"underline",skipBoundary:!0,body:t[0]}))),La("overset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1]}}),((e,t,n,r)=>`${e}{${r(n,n.overscript)}}{${r(n,n.body)}}`)),La("underset","{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",underscript:t[0],skipBoundary:!0,body:t[1]}}),((e,t,n,r)=>`${e}{${r(n,n.overscript)}}{${r(n,n.body)}}`)),La(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0},(function(e,t){return{type:"genfrac",numer:t[0],denom:t[1],hasBarLine:!1,leftDelim:t[2],rightDelim:t[3],mathstyle:"auto"}}),((e,t,n,r)=>`${r(n,n.numer)} ${e}${n.leftDelim}${n.rightDelim}${r(n,n.denom)}`)),La(["stackrel","stackbin"],"{annotation:auto}{symbol:auto}",null,(function(e,t){return{type:"overunder",overscript:t[0],skipBoundary:!0,body:t[1],mathtype:"\\stackrel"===e?"mrel":"mbin"}}),((e,t,n,r)=>`${e}{${r(n,n.overscript)}}{${r(n,n.body)}}`)),La(["phantom","vphantom","hphantom"],"{:auto*}",{},((e,t)=>({type:"phantom",captureSelection:!0,phantomType:e.slice(1),isPhantom:!0})),((e,t,n,r)=>e+"{"+r(n,n.body)+"}")),La("smash","[:string]{:auto}",null,(function(e,t){let n="smash";return"b"===t[0]?n="bsmash":"t"===t[0]&&(n="tsmash"),{type:"phantom",phantomType:n,skipBoundary:!0,body:t[1]}})),La("rlap","{:auto}",null,(function(e,t){return{type:"overlap",align:"right",skipBoundary:!0,body:t[0]}})),La("llap","{:auto}",null,(function(e,t){return{type:"overlap",align:"left",skipBoundary:!0,body:t[0]}})),La("mathrlap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"right",skipBoundary:!0,body:t[0]}})),La("mathllap","{:auto}",null,(function(e,t){return{type:"overlap",mode:"math",align:"left",skipBoundary:!0,body:t[0]}})),function(e){for(let t=0;t",">","mrel"),ua("\\gt",">","mrel"),ua("\\le","≤","mrel"),ua("\\leq","≤","mrel"),ua("\\ge","≥","mrel"),ua("\\geq","≥","mrel"),ua("\\leqslant","⩽","mrel","ams"),ua("\\geqslant","⩾","mrel","ams"),ua("\\ll","≪","mrel"),ua("\\gg","≫","mrel"),ua("\\coloneq","≔","mrel"),ua("\\measeq","≝","mrel"),ua("\\eqdef","≞","mrel"),ua("\\questeq","≟","mrel"),ua(":",":","mrel"),ua("\\cong","≅","mrel"),ua("\\equiv","≡","mrel"),ua("\\prec","≺","mrel"),ua("\\preceq","⪯","mrel"),ua("\\succ","≻","mrel"),ua("\\succeq","⪰","mrel"),ua("\\perp","⊥","mrel"),ua("\\propto","∝","mrel"),ua("\\Colon","∷","mrel"),ua("\\smile","⌣","mrel"),ua("\\frown","⌢","mrel"),ua("\\sim","∼","mrel"),ua("\\gtrsim","≳","mrel","ams"),ua("\\approx","≈","mrel"),ua("\\approxeq","≊","mrel","ams"),ua("\\thickapprox","≈","mrel","ams"),ua("\\lessapprox","⪅","mrel","ams"),ua("\\gtrapprox","⪆","mrel","ams"),ua("\\precapprox","⪷","mrel","ams"),ua("\\succapprox","⪸","mrel","ams"),ua("\\thicksim","∼","mrel","ams"),ua("\\succsim","≿","mrel","ams"),ua("\\precsim","≾","mrel","ams"),ua("\\backsim","∽","mrel","ams"),ua("\\eqsim","≂","mrel","ams"),ua("\\backsimeq","⋍","mrel","ams"),ua("\\simeq","≃","mrel"),ua("\\lesssim","≲","mrel","ams"),ua("\\nleq","≰","mrel","ams"),ua("\\ngeq","≱","mrel","ams"),ua("\\smallsmile","⌣","mrel","ams"),ua("\\smallfrown","⌢","mrel","ams"),ua("\\bowtie","⋈","mrel"),ua("\\Join","⋈","mrel"),ua("\\asymp","≍","mrel"),ua("\\sqsubseteq","⊑","mrel"),ua("\\sqsupseteq","⊒","mrel"),ua("\\leqq","≦","mrel","ams"),ua("\\eqslantless","⪕","mrel","ams"),ua("\\lll","⋘","mrel","ams"),ua("\\lessgtr","≶","mrel","ams"),ua("\\lesseqgtr","⋚","mrel","ams"),ua("\\lesseqqgtr","⪋","mrel","ams"),ua("\\risingdotseq","≓","mrel","ams"),ua("\\fallingdotseq","≒","mrel","ams"),ua("\\subseteqq","⫅","mrel","ams"),ua("\\Subset","⋐","mrel","ams"),ua("\\sqsubset","⊏","mrel","ams"),ua("\\preccurlyeq","≼","mrel","ams"),ua("\\curlyeqprec","⋞","mrel","ams"),ua("\\vDash","⊨","mrel","ams"),ua("\\Vvdash","⊪","mrel","ams"),ua("\\bumpeq","≏","mrel","ams"),ua("\\Bumpeq","≎","mrel","ams"),ua("\\geqq","≧","mrel","ams"),ua("\\eqslantgtr","⪖","mrel","ams"),ua("\\ggg","⋙","mrel","ams"),ua("\\gtrless","≷","mrel","ams"),ua("\\gtreqless","⋛","mrel","ams"),ua("\\gtreqqless","⪌","mrel","ams"),ua("\\supseteqq","⫆","mrel","ams"),ua("\\Supset","⋑","mrel","ams"),ua("\\sqsupset","⊐","mrel","ams"),ua("\\succcurlyeq","≽","mrel","ams"),ua("\\curlyeqsucc","⋟","mrel","ams"),ua("\\Vdash","⊩","mrel","ams"),ua("\\shortmid","∣","mrel","ams"),ua("\\between","≬","mrel","ams"),ua("\\pitchfork","⋔","mrel","ams"),ua("\\varpropto","∝","mrel","ams"),ua("\\backepsilon","∍","mrel","ams"),ua("\\llless","⋘","mrel","ams"),ua("\\gggtr","⋙","mrel","ams"),ua("\\lhd","⊲","mbin","ams"),ua("\\rhd","⊳","mbin","ams"),ua("\\doteq","≐","mrel"),ua("\\doteqdot","≑","mrel","ams"),ua("\\Doteq","≑","mrel","ams"),ua("\\eqcirc","≖","mrel","ams"),ua("\\circeq","≗","mrel","ams"),ua("\\lessdot","⋖","mbin","ams"),ua("\\gtrdot","⋗","mbin","ams"),ua("\\~","~","mrel"),ua("\\leftrightarrow","↔","mrel"),ua("\\Leftrightarrow","⇔","mrel"),ua("\\models","⊨","mrel"),ua("\\vdash","⊢","mrel"),ua("\\therefore","∴","mrel","ams"),ua("\\because","∵","mrel","ams"),ua("\\dashv","⊣","mrel"),ua("\\roundimplies","⥰","mrel"),ua("+","+","mbin"),ua("-","−","mbin"),ua("−","−","mbin"),ua("\\pm","±","mbin"),ua("\\mp","∓","mbin"),ua("*","∗","mbin"),ua("\\times","×","mbin"),ua("\\div","÷","mbin"),ua("\\surd","√"),ua("\\divides","∣","mbin"),ua("\\ltimes","⋉","mbin","ams"),ua("\\rtimes","⋊","mbin","ams"),ua("\\leftthreetimes","⋋","mbin","ams"),ua("\\rightthreetimes","⋌","mbin","ams"),ua("\\intercal","⊺","mbin","ams"),ua("\\dotplus","∔","mbin","ams"),ua("\\doublebarwedge","⩞","mbin","ams"),ua("\\divideontimes","⋇","mbin","ams"),ua("\\centerdot","⋅","mbin","ams"),ua("\\cdot","⋅","mbin"),ua("\\infty","∞"),ua("\\prime","′"),ua("\\doubleprime","″"),ua("\\angle","∠"),ua("`","‘"),ua("\\$","$"),ua("\\%","%"),ua("\\_","_"),ua("\\alpha","α"),ua("\\beta","β"),ua("\\gamma","γ"),ua("\\delta","δ"),ua("\\epsilon","ϵ"),ua("\\varepsilon","ε"),ua("\\zeta","ζ"),ua("\\eta","η"),ua("\\theta","θ"),ua("\\vartheta","ϑ"),ua("\\iota","ι"),ua("\\kappa","κ"),ua("\\varkappa","ϰ","mord","ams"),ua("\\lambda","λ"),ua("\\mu","μ"),ua("\\nu","ν"),ua("\\xi","ξ"),ua("\\omicron","o"),ua("\\pi","π"),ua("\\varpi","ϖ"),ua("\\rho","ρ"),ua("\\varrho","ϱ"),ua("\\sigma","σ"),ua("\\varsigma","ς"),ua("\\tau","τ"),ua("\\phi","ϕ"),ua("\\varphi","φ"),ua("\\upsilon","υ"),ua("\\chi","χ"),ua("\\psi","ψ"),ua("\\omega","ω"),ua("\\Gamma","Γ"),ua("\\Delta","Δ"),ua("\\Theta","Θ"),ua("\\Lambda","Λ"),ua("\\Xi","Ξ"),ua("\\Pi","Π"),ua("\\Sigma","Σ"),ua("\\Upsilon","Υ"),ua("\\Phi","Φ"),ua("\\Psi","Ψ"),ua("\\Omega","Ω"),ua("\\digamma","ϝ","mord","ams"),ua("\\emptyset","∅"),ua("\\varnothing","∅","mord","ams"),ua("\\cap","∩","mbin"),ua("\\cup","∪","mbin"),ua("\\setminus","∖","mbin"),ua("\\smallsetminus","∖","mbin","ams"),ua("\\complement","∁","mord","ams"),ua("\\in","∈","mrel"),ua("\\notin","∉","mrel"),ua("\\not","̸","mrel"),ua("\\ni","∋","mrel"),ua("\\owns","∋","mrel"),ua("\\subset","⊂","mrel"),ua("\\supset","⊃","mrel"),ua("\\subseteq","⊆","mrel"),ua("\\supseteq","⊇","mrel"),ua("\\subsetneq","⊊","mrel","ams"),ua("\\varsubsetneq","","mrel","ams"),ua("\\subsetneqq","⫋","mrel","ams"),ua("\\varsubsetneqq","","mrel","ams"),ua("\\nsubset","⊄","mrel","ams"),ua("\\nsupset","⊅","mrel","ams"),ua("\\nsubseteq","⊈","mrel","ams"),ua("\\nsupseteq","⊉","mrel","ams"),ua("\\ "," ","spacing"),ua("~"," ","spacing"),ua("\\space"," ","spacing"),ua("\\!",null,"spacing"),ua("\\,",null,"spacing"),ua("\\:",null,"spacing"),ua("\\;",null,"spacing"),ua("\\enskip",null,"spacing"),ua("\\enspace",null,"spacing"),ua("\\quad",null,"spacing"),ua("\\qquad",null,"spacing"),ua("\\colon",":","mpunct"),ua("\\cdotp","⋅","mpunct"),ua("\\cdots","⋯","minner"),ua("\\ddots","⋱","minner"),ua("\\ldots","…","minner"),ua("\\mathellipsis","…","minner"),ua("\\vdots","⋮"),ua("\\ldotp",".","mpunct"),ua(",",",","mpunct"),ua(";",";","mpunct"),ua("\\land","∧","mbin"),ua("\\wedge","∧","mbin"),ua("\\lor","∨","mbin"),ua("\\vee","∨","mbin"),ua("\\lnot","¬"),ua("\\neg","¬"),ua("\\barwedge","⊼","mbin","ams"),ua("\\veebar","⊻","mbin","ams"),ua("\\nor","⊻","mbin","ams"),ua("\\curlywedge","⋏","mbin","ams"),ua("\\curlyvee","⋎","mbin","ams"),ua("\\square","□","mord","ams"),ua("\\Box","□","mord","ams"),ua("\\blacksquare","■","mord","ams"),ua("\\boxminus","⊟","mbin","ams"),ua("\\boxplus","⊞","mbin","ams"),ua("\\boxtimes","⊠","mbin","ams"),ua("\\boxdot","⊡","mbin","ams"),ua("\\circ","∘","mbin"),ua("\\bigcirc","◯","mbin"),ua("\\bullet","∙","mbin"),ua("\\circleddash","⊝","mbin","ams"),ua("\\circledast","⊛","mbin","ams"),ua("\\oplus","⊕","mbin"),ua("\\ominus","⊖","mbin"),ua("\\otimes","⊗","mbin"),ua("\\odot","⊙","mbin"),ua("\\circledcirc","⊚","mbin","ams"),ua("\\oslash","⊘","mbin"),ua("\\circledS","Ⓢ","mord","ams"),ua("\\circledR","®","mord","ams"),ua("\\triangle","△"),ua("\\bigtriangleup","△","mbin"),ua("\\vartriangle","△","mrel","ams"),ua("\\triangleq","≜","mrel","ams"),ua("\\triangledown","▽","mord","ams"),ua("\\bigtriangledown","▽","mbin"),ua("\\triangleleft","◃","mbin"),ua("\\vartriangleleft","⊲","mrel","ams"),ua("\\trianglelefteq","⊴","mrel","ams"),ua("\\ntriangleleft","⋪","mrel","ams"),ua("\\ntrianglelefteq","⋬","mrel","ams"),ua("\\triangleright","▹","mbin"),ua("\\vartriangleright","⊳","mrel","ams"),ua("\\trianglerighteq","⊵","mrel","ams"),ua("\\ntriangleright","⋫","mrel","ams"),ua("\\ntrianglerighteq","⋭","mrel","ams"),ua("\\blacktriangle","▲","mord","ams"),ua("\\blacktriangledown","▼","mord","ams"),ua("\\blacktriangleleft","◀","mrel","ams"),ua("\\blacktriangleright","▶","mrel","ams"),ua("\\/","/"),ua("|","∣","textord"),ua("\\And","&","mbin"),ua("\\imath","ı"),ua("\\jmath","ȷ"),ua("\\degree","°"),ua("'","′"),ua('"',"”");const qa=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"],Fa=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],Ha=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Wa=[0,1.2,1.8,2.4,3],Va=[{type:"small",mathstyle:Li.scriptscriptstyle},{type:"small",mathstyle:Li.scriptstyle},{type:"small",mathstyle:Li.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ua=[{type:"small",mathstyle:Li.scriptscriptstyle},{type:"small",mathstyle:Li.scriptstyle},{type:"small",mathstyle:Li.textstyle},{type:"stack"}],Za=[{type:"small",mathstyle:Li.scriptscriptstyle},{type:"small",mathstyle:Li.scriptstyle},{type:"small",mathstyle:Li.textstyle},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ga(e,t,n,r,o,i=""){if(!t||0===t.length||"."===t)return Ya(e,o,e);let a;"<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),a=Ha.includes(t)?Va:qa.includes(t)?Za:Ua;const s=function(e,t,n,r){for(let i=Math.min(2,3-r.mathstyle.size);it)return n[i]}var o;return n[n.length-1]}(ba(t),n,a,o);return"small"===s.type?function(e,t,n,r,o,i=""){const a=Yi(e,Gi("Main-Regular",ba(t)),o.mathstyle,n,i);return r&&a.setTop((1-o.mathstyle.sizeMultiplier/n.sizeMultiplier)*o.mathstyle.metrics.axisHeight),a.setStyle("color",o.color),"number"==typeof o.opacity&&a.setStyle("opacity",o.opacity),a}(e,t,s.mathstyle,r,o,"ML__small-delim "+i):"large"===s.type?ja(e,t,s.size,r,o,i):(console.assert("stack"===s.type),Ka(e,t,n,r,o,i))}function Xa(e,t,n,r,o,i=""){if("."===t)return Ya(e,o,i);const a=o.mathstyle.metrics.axisHeight*o.mathstyle.sizeMultiplier,s=5/yi,l=Math.max(n-a,r+a);return Ga(e,t,Math.max(l/500*901,2*l-s),!0,o,i)}function Ya(e,t,n){return Zi("","sizing"+t.mathstyle.adjustTo(Li.textstyle)+" nulldelimiter "+(n||""),e)}const Ja=8205,Qa=[[Ja,1],[65038,2],[127995,5],[129456,4],[917536,96]];let es;const ts=[127462,127487];function ns(e){var t;return void 0===es&&(es={},Qa.forEach((e=>{for(let t=e[0];t<=e[0]+e[1]-1;t++)es[t]=!0}))),null!==(t=es[e])&&void 0!==t&&t}function rs(e){return e>=ts[0]&&e<=ts[1]}function is(e){if(/^[\x20-\xFF]*$/.test(e))return e;const t=[],n=function(e){const t=[];for(let n=0;n=55296&&r<=56319){const t=e.charCodeAt(n+1);if(t>=56320&&t<=57343){const e=r-55296,o=t-56320;r=Math.pow(2,16)+e*Math.pow(2,10)+o,n++}}t.push(r)}return t}(e);let r=0;for(;r=this.s.length}get(){return this.pos";if(this.obeyspaces&&this.match(/^[ \f\n\r\t\v\xA0\u2028\u2029]/))return"";const e=this.get();if("\\"===e){if(!this.end()){let e=this.match(/^[a-zA-Z*]+/);if(e)this.match(/^[ \f\n\r\t\v\xA0\u2028\u2029]*/);else if(e=this.get()," "===e)return"";return"\\"+e}}else{if("{"===e)return"<{>";if("}"===e)return"<}>";if("^"===e){if("^"===this.peek()){this.get();const e=this.match(/^(\^(\^(\^(\^[0-9a-f])?[0-9a-f])?[0-9a-f])?[0-9a-f])?[0-9a-f][0-9a-f]/);if(e)return String.fromCodePoint(parseInt(e.slice(e.lastIndexOf("^")+1),16))}return e}if("#"===e){if(!this.end()){let e=!1;if(/[0-9?]/.test(this.peek())&&(e=!0,this.pos+1"):"<$>"}return e}}function ss(e,t){var n,r,o,i;let a=[],s=e.next();if(s)if("\\relax"===s);else if("\\noexpand"===s)s=e.next(),s&&a.push(s);else if("\\obeyspaces"===s)e.obeyspaces=!0;else if("\\space"===s||"~"===s)a.push("");else if("\\bgroup"===s)a.push("<{>");else if("\\egroup"===s)a.push("<}>");else if("\\string"===s)s=e.next(),s&&("\\"===s[0]?Array.from(s).forEach((e=>a.push("\\"===e?"\\backslash":e))):"<{>"===s?a.push("\\{"):""===s?a.push("~"):"<}>"===s&&a.push("\\}"));else if("\\csname"===s){for(;""===e.peek();)e.next();let o="",i=!1,l=[];do{if(0===l.length)if(/^#[0-9?]$/.test(e.peek())){const o=e.get().slice(1);l=ls(null!==(r=null!==(n=null==t?void 0:t[o])&&void 0!==n?n:null==t?void 0:t["?"])&&void 0!==r?r:"\\placeholder{}",t),s=l[0]}else s=e.next(),l=s?[s]:[];i=0===l.length,i||"\\endcsname"!==s||(i=!0,l.shift()),i||(i="<$>"===s||"<$$>"===s||"<{>"===s||"<}>"===s||s.length>1&&"\\"===s[0]),i||(o+=l.shift())}while(!i);o&&a.push("\\"+o),a=a.concat(l)}else if("\\endcsname"===s);else if(s.length>1&&"#"===s[0]){const e=s.slice(1);a=a.concat(ls(null!==(i=null!==(o=null==t?void 0:t[e])&&void 0!==o?o:null==t?void 0:t["?"])&&void 0!==i?i:"\\placeholder{}",t))}else a.push(s);return a}function ls(e,t){const n=e.toString().split(/\r?\n/);let r="",o="";for(const e of n){r+=o,o=" ";const t=e.match(/((?:\\%)|[^%])*/);null!==t&&(r+=t[0])}const i=new as(r);let a=[];do{a=a.concat(ss(i,t))}while(!i.end());return a}function cs(e){let t="",n="";for(const r of e)r&&(/[a-zA-Z*]/.test(r[0])&&(n+=t),t=/\\[a-zA-Z]+\*?$/.test(r)?" ":"",n+=r);return n}function ds(e){return cs(e.map((e=>{var t;return null!==(t={"":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[e])&&void 0!==t?t:e})))}function us(e,t){if(!(t=void 0!==t&&t)&&e.latex)return e.latex;let n="",r=0,o=0,i=0;const a=e.symbol;let s=[];const l=(e,n)=>function(e,t,n){let r="";return si(t)?r=function(e,t,n){if(0===t.length)return"";if("first"===t[0].type){if(1===t.length)return"";t=t.slice(1)}return 0===t.length?"":cs(Pi(t,"cssClass").map((t=>{const r=cs(Pi(t,"color").map((t=>cs(function(e){const t=[];let n=[],r="NONE";return e.forEach((e=>{"first"!==e.type&&(e.mode!==r?(n.length>0&&t.push(n),n=[e],r=e.mode):n.push(e))})),n.length>0&&t.push(n),t}(t).map((t=>function(e,t,n){var r;return(null===(r=Ii[t[0].mode])||void 0===r?void 0:r.emitLatexRun)?Ii[t[0].mode].emitLatexRun(e,t,n):""}(e,t,n)))))));return!t[0].cssClass||void 0!==e&&e.cssClass===t[0].cssClass?r:"ML__boldsymbol"===t[0].cssClass?"\\boldsymbol{"+r+"}":"ML__emph"===t[0].cssClass?"\\emph{"+r+"}":"\\class{"+t[0].cssClass+"}{"+r+"}"})))}(e,t,n):"number"==typeof t||"boolean"==typeof t?r=t.toString():"string"==typeof t?r=t.replace(/\s/g,"~"):null!=t&&"function"==typeof t.toLatex&&(r=t.toLatex(n)),r}(e,n,t);switch(e.type){case"group":a?n=t?l(e,e.body):e.latex:(n=e.latexOpen||(e.cssId||e.cssClass?"":"{"),e.cssId&&(n+="\\cssId{"+e.cssId+"}{"),"ML__emph"===e.cssClass?n+=`\\emph{${l(e,e.body)}`:(e.cssClass&&(n+="\\class{"+e.cssClass+"}{"),n+=l(e,e.body),e.cssClass&&(n+="}")),e.cssId&&(n+="}"),n+=e.latexClose||(e.cssId||e.cssClass?"":"}"));break;case"array":if(n+="\\begin{"+e.environmentName+"}","array"===e.environmentName){if(n+="{",void 0!==e.colFormat)for(i=0;i0&&(n+=" & "),n+=l(e,e.array[o][r]);oe.selected(!0))),console.assert(!l||si(l));else{let e=[],c="",d=!0,u=null;for(let p=0;pe.selected(!0)))):(e.length>0&&(l=[...l,...e],e=[]),l=l.concat(n))}}e.length>0&&(l=[...l,...e],e=[])}}else t instanceof gs&&(l=t.decompose(a),l&&s&&t.isSelected&&l.forEach((e=>e.selected(!0))));if(!l||0===l.length)return null;if(console.assert(si(l)&&l.length>0),a.mathstyle!==a.parentMathstyle){const e=a.mathstyle.sizeMultiplier/a.parentMathstyle.sizeMultiplier;for(const t of l)console.assert(!si(t)),console.assert("number"==typeof t.height&&isFinite(t.height)),t.height*=e,t.depth*=e}if(a.size!==a.parentSize){const e=hs[a.size]/hs[a.parentSize];for(const t of l)console.assert(!si(t)),console.assert("number"==typeof t.height&&isFinite(t.height)),t.height*=e,t.depth*=e}return l}class gs{constructor(e,t,n="",r={}){console.assert("first"===t||Boolean(e)),this.mode=e,this.type=t,this.body=n,r.isPhantom&&this.setPhantom(!0),this.applyStyle(r)}toLatex(e=!1){return us(this,e)}getStyle(){return{mode:this.mode,color:this.isPhantom?"transparent":this.color,backgroundColor:this.isPhantom?"transparent":this.backgroundColor,variant:this.variant,variantStyle:this.variantStyle,fontFamily:this.fontFamily,fontShape:this.fontShape,fontSeries:this.fontSeries,fontSize:this.fontSize,cssId:this.cssId,cssClass:this.cssClass}}applyStyle(e){Object.assign(this,e),"none"===this.fontFamily&&(this.fontFamily=""),"auto"===this.fontShape&&(this.fontShape=""),"auto"===this.fontSeries&&(this.fontSeries=""),"none"===this.color&&(this.color=""),"none"===this.backgroundColor&&(this.backgroundColor=""),"auto"===this.fontSize&&(this.fontSize=""),this.fontSize&&(this.maxFontSize=hs[this.fontSize]),"text"===this.mode&&"root"!==this.type&&(this.type="")}getInitialBaseElement(){let e;return si(this.body)&&this.body.length>0&&("first"!==this.body[0].type?e=this.body[0].getInitialBaseElement():this.body[1]&&(e=this.body[1].getInitialBaseElement())),e||this}getFinalBaseElement(){return si(this.body)&&this.body.length>0?this.body[this.body.length-1].getFinalBaseElement():this}isCharacterBox(){const e=this.getInitialBaseElement();return/minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(e.type)}setPhantom(e){this.forEach((t=>{t.isPhantom=e}))}forEach(e){if(e(this),si(this.body))for(const t of this.body)t&&t.forEach(e);else this.body&&"object"==typeof this.body&&e(this.body);if(this.superscript)for(const t of this.superscript)t&&t.forEach(e);if(this.subscript)for(const t of this.subscript)t&&t.forEach(e);if(this.overscript)for(const t of this.overscript)t&&t.forEach(e);if(this.underscript)for(const t of this.underscript)t&&t.forEach(e);if(this.numer)for(const t of this.numer)t&&t.forEach(e);if(this.denom)for(const t of this.denom)t&&t.forEach(e);if(this.index)for(const t of this.index)t&&t.forEach(e);if(this.array)for(const t of this.array)for(const n of t)for(const t of n)t.forEach(e)}decomposeGroup(e){const t=Zi(ms(e.clone({mathstyle:this.mathstyle?Li[this.mathstyle]:void 0}),this.body),"","mord");return this.cssId&&(t.cssId=this.cssId),t.applyStyle({backgroundColor:this.backgroundColor,cssClass:this.cssClass}),t}decomposeOverlap(e){const t=Zi(ms(e,this.body),"inner");return Zi([t,Zi(null,"fix")],"left"===this.align?"llap":"rlap","mord")}decomposeRule(e){const t=e.mathstyle,n=Zi("","rule","mord");let r=this.shift&&!isNaN(this.shift)?this.shift:0;r/=t.sizeMultiplier;const o=this.width/t.sizeMultiplier,i=this.height/t.sizeMultiplier;return n.setStyle("border-right-width",o,"em"),n.setStyle("border-top-width",i,"em"),n.setStyle("margin-top",-(i-r),"em"),n.setStyle("border-color",e.color),n.width=o,n.height=i+r,n.depth=-r,n}decompose(e,t=null){var n;let r=null;if(!this.type||/mord|minner|mbin|mrel|mpunct|mopen|mclose|textord/.test(this.type)?(r="string"==typeof this.body?this.makeSpan(e,this.body):this.makeSpan(e,ms(e,this.body)),r.type=Bi(this.type)?this.type:""):"group"===this.type||"root"===this.type?r=this.decomposeGroup(e):"delim"===this.type?(r=Zi(null,""),r.delim=this.delim):"sizeddelim"===this.type?r=this.bind(e,function(e,t,n,r,o=""){return"."===t?Ya(e,r,o):("<"===t||"\\lt"===t?t="\\langle":">"!==t&&"\\gt"!==t||(t="\\rangle"),qa.includes(t)||Ha.includes(t)?ja(e,t,n,!1,r,o):Fa.includes(t)?Ka(e,t,Wa[n],!1,r,o):(console.assert(!1,"Unknown delimiter '"+t+"'"),null))}(this.cls,this.delim,this.size,e)):"overlap"===this.type?r=this.decomposeOverlap(e):"rule"===this.type?r=this.decomposeRule(e):"msubsup"===this.type?(r=Zi("​","","mord"),t&&(r.height=t[0].height,r.depth=t[0].depth)):"space"===this.type?r=this.makeSpan(e," "):"spacing"===this.type?"​"===this.body?r=this.makeSpan(e,"​"):" "===this.body?r="math"===this.mode?this.makeSpan(e," "):this.makeSpan(e," "):this.width?(r=Zi("​","mspace "),this.width>0?r.setWidth(this.width):r.setStyle("margin-left",this.width,"em")):r=Zi("​","mspace "+(null!==(n={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.symbol])&&void 0!==n?n:"mediumspace")):"mathstyle"===this.type?e.setMathstyle(this.mathstyle):"command"===this.type||"error"===this.type?(console.assert("string"==typeof this.body),r=this.makeSpan(e,this.body),r.classes="",this.isError&&(r.classes+=" ML__error"),this.isSuggestion&&(r.classes+=" ML__suggestion")):"composition"===this.type?(r=this.makeSpan(e,this.body),r.classes="ML__composition"):"placeholder"===this.type?r=this.makeSpan(e,"⬚"):"first"===this.type?r=this.makeSpan(e,"​"):(console.assert(ps[this.type],'Unknown Atom type: "'+this.type+'"'),r=ps[this.type].decompose(e,this)),!r)return null;if(this.caret&&"msubsup"!==this.type&&"command"!==this.type&&"placeholder"!==this.type&&"first"!==this.type&&(si(r)?"leftright"===this.type&&(this.superscript||this.subscript)||(r[r.length-1].caret=this.caret):r.caret=this.caret),this.containsCaret&&(si(r)?(r[0].classes=(r[0].classes||"")+" ML__contains-caret",r[r.length-1].classes=(r[r.length-1].classes||"")+" ML__contains-caret"):r.classes=(r.classes||"")+" ML__contains-caret"),!this.limits&&(this.superscript||this.subscript))if(si(r)){const t=r[r.length-1];r[r.length-1]=this.attachSupsub(e,t,t.type)}else r=[this.attachSupsub(e,r,r.type)];return si(r)?r:[r]}attachSupsub(e,t,n){if(!this.superscript&&!this.subscript)return t;const r=e.mathstyle;let o=null,i=null;this.superscript&&(o=Zi(ms(e.sup(),this.superscript),r.adjustTo(r.sup()))),this.subscript&&(i=Zi(ms(e.sub(),this.subscript),r.adjustTo(r.sub())));let a,s=0,l=0;this.isCharacterBox()||(s=Wi(t)-r.metrics.supDrop,l=Vi(t)+r.metrics.subDrop),a=r===Li.displaystyle?r.metrics.sup1:r.cramped?r.metrics.sup3:r.metrics.sup2;const c=Li.textstyle.sizeMultiplier*r.sizeMultiplier,d=.5/yi/c;let u=null;if(i&&o){s=Math.max(s,a,o.depth+.25*r.metrics.xHeight),l=Math.max(l,r.metrics.sub2);const n=ui;if(s-Vi(o)-(Wi(i)-l)<4*n){l=4*n-(s-o.depth)+Wi(i);const e=.8*r.metrics.xHeight-(s-Vi(o));e>0&&(s+=e,l-=e)}u=Qi(e,[i,l,o,-s],"individualShift"),this.isSymbol&&u.children[0].setLeft(-Ui(t))}else i&&!o?(l=Math.max(l,r.metrics.sub1,Wi(i)-.8*r.metrics.xHeight),u=Qi(e,[i],"shift",l),u.children[0].setRight(d),this.isCharacterBox()&&u.children[0].setLeft(-Ui(t))):!i&&o&&(s=Math.max(s,a,o.depth+.25*r.metrics.xHeight),u=Qi(e,[o],"shift",-s),u.children[0].setRight(d));const p=Zi(u,"msubsup");return this.caret&&(p.caret=this.caret,this.caret=""),Zi([t,p],"",n)}attachLimits(e,t,n,r){const o=this.superscript?Zi(ms(e.sup(),this.superscript),e.mathstyle.adjustTo(e.mathstyle.sup())):null,i=this.subscript?Zi(ms(e.sub(),this.subscript),e.mathstyle.adjustTo(e.mathstyle.sub())):null;return function(e,t,n,r,o,i){if(!o&&!i)return t;t=Zi(t);let a=0,s=0;o&&(a=Math.max(pi,fi-Vi(o))),i&&(s=Math.max(hi,mi-Wi(i)));let l=null;if(i&&o){const c=gi+Wi(i)+Vi(i)+s+Vi(t)+n;l=Qi(e,[gi,i,s,t,a,o,gi],"bottom",c),l.children[0].setLeft(-r),l.children[2].setLeft(r)}else if(i&&!o){const o=Wi(t)-n;l=Qi(e,[gi,i,s,t],"top",o),l.children[0].setLeft(-r)}else if(!i&&o){const i=Vi(t)+n;l=Qi(e,[t,a,o,gi],"bottom",i),l.children[1].setLeft(r)}return Zi(l,"op-limits","mop")}(e,t,n,r,o,i)}bind(e,t){return"first"!==this.type&&"​"!==this.body&&(this.id=function(e){let t;return e.atomIdsSettings&&("number"==typeof e.atomIdsSettings.seed?(t=e.atomIdsSettings.overrideID?e.atomIdsSettings.overrideID:e.atomIdsSettings.seed.toString(36),e.atomIdsSettings.seed+=1):t=Date.now().toString(36).slice(-2)+Math.floor(1e5*Math.random()).toString(36)),t}(e),this.id&&(t.attributes||(t.attributes={}),t.attributes["data-atom-id"]=this.id)),t}makeSpan(e,t){console.assert(Bi(this.type));const n=Zi(t,"","textord"===this.type?"mord":Bi(this.type)?this.type:""),r=this.getStyle();r.letterShapeStyle=e.letterShapeStyle,n.applyStyle(r);const o=(null==r?void 0:r.fontSize)?r.fontSize:"size5";return o!==e.parentSize?(n.classes+=" sizing reset-"+e.parentSize,n.classes+=" "+o):e.parentSize!==e.size&&(n.classes+=" sizing reset-"+e.parentSize,n.classes+=" "+e.size),n.maxFontSize=Math.max(n.maxFontSize,e.mathstyle.sizeMultiplier||1),"text"===this.mode&&(n.classes+=" ML__text"),e.mathstyle.isTight()&&(n.isTight=!0),"math"!==this.mode&&(n.italic=0),n.setRight(n.italic),"number"==typeof e.opacity&&n.setStyle("opacity",e.opacity),this.bind(e,n),this.caret&&(this.superscript||this.subscript||(n.caret=this.caret,this.caret="",e.mathstyle.isTight()&&(n.isTight=!0))),n}}function ys(e,t=[]){const n=new gs(e,"root",t||[]);return!si(n.body)||0!==n.body.length&&"first"===n.body[0].type||n.body.unshift(new gs(e,"first")),n}function vs(e){return si(e)}function bs(e){const t=Zi("​","arraycolsep");return t.setWidth(e),t}function xs(e,t,n,r){const o=[];for(const i of t){const t=Zi(ms(e,r));t.depth=i.depth,t.height=i.height,o.push(t),o.push(i.pos-n)}return Qi(e,o,"individualShift")}function ws(e){return!/^<({|}|\$|\$\$|space)>$/.test(e)}fs("accent",((e,t)=>{const n=e.mathstyle;let r=ms(e.cramp(),t.body);(t.superscript||t.subscript)&&(r=[t.attachSupsub(e,Zi(r,"","mord"),"mord")]);let o=0;si(t.body)&&1===t.body.length&&t.body[0].isCharacterBox()&&(o=function(e){if(!e)return 0;if(si(e)){let t=0;for(const n of e)t+=n.skew||0;return t}return e.skew}(r));let i,a=Math.min(Wi(r),n.metrics.xHeight);if(t.svgAccent)i=ea(t.svgAccent),a=-a+pi;else{const e=Gi("Main-Regular",t.accent,"math");e.italic=0;const n="⃗"===t.accent?" accent-vec":"";i=Zi(Zi(e),"accent-body"+n)}return i=Qi(e,[r,-a,i]),i.children[1].setLeft(2*o),[Zi([i],"accent","mord")]})),fs("array",((e,t)=>{var n;let r=t.colFormat;r&&0===r.length&&(r=[{align:"l"}]),r||(r=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]);const o=[];let i=0;for(const e of r)e.align&&i++;for(const e of t.array){let t=0;for(;t0&&(c+=u,s0&&y.push(Qi(e,n,"individualShift"))}const v=[];let b=!1,x=!1,w=0,k=!t.leftDelim;for(const t of r){if(t.align&&w>=y.length)break;if(t.align&&w{const n="number"==typeof t.padding?t.padding:ki,r=Zi(ms(e,t.body),"","mord");r.setStyle("vertical-align",-Vi(r),"em"),r.setStyle("height",0);const o=Zi(r,"","mord"),i=Zi("","ML__box");i.setStyle("position","absolute"),i.setStyle("height",Wi(o)+Vi(o)+2*n,"em"),0!==n?i.setStyle("width","calc(100% + "+2*n+"em)"):i.setStyle("width","100%"),i.setStyle("top",-n,"em"),i.setStyle("left",-n,"em"),i.setStyle("z-index","-1"),i.setStyle("box-sizing","border-box"),t.backgroundcolor&&i.setStyle("background-color",t.backgroundcolor),t.framecolor&&i.setStyle("border",_i+"em solid "+t.framecolor),t.border&&i.setStyle("border",t.border),o.setStyle("display","inline-block"),o.setStyle("height",Wi(o)+Vi(o),"em");const a=Zi([i,o]);return a.setStyle("position","relative"),a.setStyle("vertical-align",-n+Vi(o),"em"),a.height=Wi(o)+n,a.depth=Vi(o)+n,a.setLeft(n),a.setRight(n),a.setStyle("height",a.height+a.depth-2*n,"em"),a.setStyle("top",-n,"em"),a.setStyle("display","inline-block"),[a]})),fs("enclose",((e,t)=>{const n=Zi(ms(e,t.body),"","mord"),r="number"==typeof t.padding?t.padding:ki,o=Zi("","ML__notation");o.setStyle("position","absolute"),o.setStyle("height",Wi(n)+Vi(n)+2*r,"em"),o.height=Wi(n)+r,o.depth=Vi(n)+r,0!==r?o.setStyle("width","calc(100% + "+2*r+"em)"):o.setStyle("width","100%"),o.setStyle("top","0"),o.setStyle("left",-r,"em"),o.setStyle("z-index","-1"),t.backgroundcolor&&o.setStyle("background-color",t.backgroundcolor),t.notation.box&&o.setStyle("border",t.borderStyle),t.notation.actuarial&&(o.setStyle("border-top",t.borderStyle),o.setStyle("border-right",t.borderStyle)),t.notation.madruwb&&(o.setStyle("border-bottom",t.borderStyle),o.setStyle("border-right",t.borderStyle)),t.notation.roundedbox&&(o.setStyle("border-radius",(Wi(n)+Vi(n))/2,"em"),o.setStyle("border",t.borderStyle)),t.notation.circle&&(o.setStyle("border-radius","50%"),o.setStyle("border",t.borderStyle)),t.notation.top&&o.setStyle("border-top",t.borderStyle),t.notation.left&&o.setStyle("border-left",t.borderStyle),t.notation.right&&o.setStyle("border-right",t.borderStyle),t.notation.bottom&&o.setStyle("border-bottom",t.borderStyle);let i="";if(t.notation.horizontalstrike&&(i+='{const n="auto"===t.mathstyle?e.mathstyle:Li[t.mathstyle],r=e.clone({mathstyle:n});let o=[];t.numerPrefix&&o.push(Zi(t.numerPrefix,"mord"));const i=t.continuousFraction?n:n.fracNum();o=o.concat(ms(r.clone({mathstyle:i}),t.numer));const a=Ji(o,e.mathstyle.adjustTo(i));let s=[];t.denomPrefix&&s.push(Zi(t.denomPrefix,"mord"));const l=t.continuousFraction?n:n.fracDen();s=s.concat(ms(r.clone({mathstyle:l}),t.denom));const c=Ji(s,e.mathstyle.adjustTo(l)),d=t.hasBarLine?ui/n.sizeMultiplier:0;let u,p,h=0;n.size===Li.displaystyle.size?(u=n.metrics.num1,h=d>0?3*d:7*ui,p=n.metrics.denom1):(d>0?(u=n.metrics.num2,h=d):(u=n.metrics.num3,h=3*ui),p=n.metrics.denom2);const f=a?Vi(a):0,m=c?Wi(c):0;let g;if(0===d){const e=u-f-(m-p);e{if(!t.body)return t.leftDelim?new gs("math","mopen",t.leftDelim).decompose(e):t.rightDelim?new gs("math","mclose",t.rightDelim).decompose(e):null;const n=e.clone(),r=ms(n,t.body),o=n.mathstyle;let i=0,a=0,s=[];if(i=Wi(r)*o.sizeMultiplier,a=Vi(r)*o.sizeMultiplier,t.leftDelim&&(s.push(t.bind(e,Xa("mopen",t.leftDelim,i,a,n,"ML__open"))),s[s.length-1].applyStyle(t.getStyle())),r){for(let o=0;o{const n=e.mathstyle,r=ms(e.cramp(),t.body),o=ui/n.sizeMultiplier,i=Zi(null,e.mathstyle.adjustTo(Li.textstyle)+" "+t.position+"-line");let a;if(i.height=o,i.maxFontSize=1,"overline"===t.position)a=Qi(e,[r,3*o,i,o]);else{const t=Zi(r);a=Qi(e,[o,i,3*o,t],"top",Wi(t))}return[Zi(a,t.position,"mord")]})),fs("mop",((e,t)=>{var n;const r=e.mathstyle;let o,i=0,a=0;if(t.isSymbol){const n=r.size===Li.displaystyle.size&&"\\smallint"!==t.symbol;o=Gi(n?"Size2-Regular":"Size1-Regular",t.body,"op-symbol "+(n?"large-op":"small-op"),"mop"),i=(o.height-o.depth)/2-r.metrics.axisHeight*r.sizeMultiplier,a=o.italic,o.applyStyle({color:t.isPhantom?"transparent":t.color,backgroundColor:t.isPhantom?"transparent":t.backgroundColor,cssId:t.cssId,cssClass:t.cssClass,letterShapeStyle:e.letterShapeStyle})}else si(t.body)?o=Zi(ms(e,t.body),"","mop"):(console.assert("mop"===t.type),o=t.makeSpan(e,t.body));t.bind(e,o),t.isSymbol&&o.setTop(i);let s=o;if(t.superscript||t.subscript){const l=null!==(n=t.limits)&&void 0!==n?n:"auto";s="limits"===l||"auto"===l&&r.size===Li.displaystyle.size?t.attachLimits(e,o,i,a):t.attachSupsub(e,o,"mop")}return[s]})),fs("overunder",((e,t)=>{const n=t.svgBody?ea(t.svgBody):ms(e,t.body),r=e.clone({mathstyle:Li.scriptstyle});let o,i;t.svgAbove?o=ea(t.svgAbove):t.overscript&&t.overscript.length>0&&(o=Zi(ms(r,t.overscript),e.mathstyle.adjustTo(r.mathstyle))),t.svgBelow?i=ea(t.svgBelow):t.underscript&&t.underscript.length>0&&(i=Zi(ms(r,t.underscript),e.mathstyle.adjustTo(r.mathstyle))),o&&i&&(i.setLeft(.3),i.setRight(.3),o.setLeft(.3),o.setRight(.3));let a=function(e,t,n,r,o){if(!n&&!r)return Zi(t,"op-over-under",o);let i=0,a=0;n&&(i=Math.max(pi,fi-Vi(n))),r&&(a=Math.max(hi,mi-Wi(r)));let s=null;if(r&&n){const o=Wi(r)+Vi(r)+Vi(t);s=Qi(e,[0,r,a,t,i,n,hi],"bottom",o)}else r&&!n?s=Qi(e,[0,r,a,t],"top",Wi(t)):n&&!r&&(s=Qi(e,[Vi(t),t,Math.max(hi,i),n],"bottom",Vi(t)));return Zi(s,"op-over-under",o)}(e,n,o,i,Bi(t.type)?t.type:"mrel");return(t.superscript||t.subscript)&&(a=t.attachLimits(e,a,0,0)),[a]})),fs("phantom",((e,t)=>{if("vphantom"===t.phantomType){const n=Zi(ms(e,t.body),"inner");return[Zi([n,Zi(null,"fix")],"rlap","mord")]}if("hphantom"===t.phantomType||"smash"===t.phantomType||"bsmash"===t.phantomType||"tsmash"===t.phantomType){const n=Zi(ms(e,t.body),"","mord");return"bsmash"!==t.phantomType&&(n.height=0),"tsmash"!==t.phantomType&&(n.depth=0),[Zi(Qi(e,[n]),"","mord")]}return[Zi(ms(e,t.body),"","mord")]})),fs("surd",((e,t)=>{var n;const r=e.mathstyle;console.assert(null===t.body||si(t.body));const o=null!==(n=ms(e.cramp(),t.body))&&void 0!==n?n:Zi(""),i=ui/r.sizeMultiplier;let a=i;r.idWi(o)+Vi(o)+s&&(s=(s+c-(Wi(o)+Vi(o)))/2),l.setTop(l.height-Wi(o)-(s+i));const d=Zi(null,e.mathstyle.adjustTo(Li.textstyle)+" sqrt-line");d.applyStyle(t.getStyle()),d.height=i;const u=Qi(e,[o,s,d,i]);if(!t.index)return[t.bind(e,Zi([l,u],"sqrt","mord"))];const p=Zi(ms(e.clone({mathstyle:Li.scriptscriptstyle}),t.index),r.adjustTo(Li.scriptscriptstyle)),h=Zi([Zi(Qi(e,[p],"shift",-.6*(Math.max(l.height,u.height)-Math.max(l.depth,u.depth))),"root"),l,u],"sqrt","mord");return h.height=l.height,h.depth=l.depth,[t.bind(e,h)]}));class ks{constructor(e,t,n,r){this.index=0,this.style={},this.parseMode="math",this.smartFence=!1,this.tabularMode=!1,this.atoms=[],this.endCount=0,this.tokens=e,this.args=t,this.macros=n,this.onError=e=>r({before:ds(this.tokens.slice(this.index,this.index+10)),after:ds(this.tokens.slice(Math.max(0,this.index-10),this.index)),...e})}swapAtoms(e=[]){const t=this.atoms;return this.atoms=e,t}swapParseMode(e){const t=this.parseMode;return this.parseMode=e,t}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}get(){return this.endCount=0,this.index");)e=!0;return e}skipUntilToken(e){let t=this.tokens[this.index];for(;t&&t!==e;)t=this.tokens[++this.index];t===e&&this.index++}skipFiller(){let e=!1;do{const t=this.matchWhitespace(),n=this.match("\\relax");e=!t&&!n}while(!e)}matchKeyword(e){const t=this.index;let n=this.end(),r="";for(;!n;){const t=this.get();ws(t)?(r+=t,n=this.end()||r.length>=e.length):n=!0}const o=e.toUpperCase()===r.toUpperCase();return o||(this.index=t),o}scanString(){let e="",t=this.end();for(;!t;){if(this.match(""))e+=" ";else{const n=this.peek();"]"===n?t=!0:ws(n)?e+=this.get():"\\"===n[0]?(this.onError({code:"unbalanced-braces"}),e+=this.get()):t=!0}t=t||this.end()}return e}scanBalancedString(){let e="",t=this.end(),n=1;for(;!t;){if(this.match(""))e+=" ";else{const t=this.get();"<{>"===t?(e+="{",n+=1):"<}>"===t?(n-=1,n>0?e+="}":this.index-=1):e+="<$>"===t?"$":"<$$>"===t?"$$":t}t=0===n||this.end()}return e}matchLiteralArg(){var e;let t="";if(this.match("<{>")){let n=1;for(;n>0&&!this.end();){const r=this.get();"<}>"===r?(n-=1,n>0&&(t+="}")):"<{>"===r?(n+=1,t+="{"):t+=null!==(e={"":" ","<$$>":"$$","<$>":"$"}[r])&&void 0!==e?e:r}}return t}scanColor(){return Na(this.scanString())}scanNumber(e=!0){var t,n;let r=!1,o=this.peek();for(;""===o||"+"===o||"-"===o;)this.get(),"-"===o&&(r=!r),o=this.peek();e=Boolean(e);let i=10,a=/[0-9]/;if(this.match("'"))i=8,a=/[0-7]/,e=!0;else if(this.match('"')||this.match("x"))i=16,a=/[0-9A-F]/,e=!0;else if(this.match("`"))return o=this.get(),o?o.startsWith("\\")&&2===o.length?(r?-1:1)*(null!==(t=o.codePointAt(1))&&void 0!==t?t:0):(r?-1:1)*(null!==(n=o.codePointAt(0))&&void 0!==n?n:0):NaN;let s="";for(;this.hasPattern(a);)s+=this.get();if(!e&&(this.match(".")||this.match(",")))for(s+=".";this.hasPattern(a);)s+=this.get();const l=e?parseInt(s,i):parseFloat(s);return r?-l:l}scanDimen(){const e=this.scanNumber(!1);let t;return this.matchWhitespace(),this.matchKeyword("pt")?t=Ei(e,"pt"):this.matchKeyword("mm")?t=Ei(e,"mm"):this.matchKeyword("cm")?t=Ei(e,"cm"):this.matchKeyword("ex")?t=Ei(e,"ex"):this.matchKeyword("px")?t=Ei(e,"px"):this.matchKeyword("em")?t=Ei(e,"em"):this.matchKeyword("bp")?t=Ei(e,"bp"):this.matchKeyword("dd")?t=Ei(e,"dd"):this.matchKeyword("pc")?t=Ei(e,"pc"):this.matchKeyword("in")?t=Ei(e,"in"):this.matchKeyword("mu")?t=Ei(e,"mu"):(this.onError({code:"missing-unit"}),t=Ei(e,"pt")),t}scanSkip(){const e=this.scanDimen();return this.matchWhitespace(),this.matchKeyword("plus")&&this.scanDimen(),this.matchWhitespace(),this.matchKeyword("minus")&&this.scanDimen(),e}scanColspec(){this.matchWhitespace();const e=[];for(;!this.end()&&"<}>"!==this.peek()&&"]"!==this.peek();){const t=this.get();if("c"===t||"r"===t||"l"===t)e.push({align:t});else if("|"===t)e.push({rule:!0});else if("@"===t){if(this.match("<{>")){const t=this.swapParseMode("math");e.push({gap:this.parse((e=>"<}>"===e))}),this.swapParseMode(t)}this.match("<}>")||this.onError({code:"unbalanced-braces"})}}return e}parseModeSet(){let e="";if(this.match("\\(")&&(e="\\)"),!e&&this.match("\\[")&&(e="\\]"),!e)return null;const t=this.swapParseMode("math"),n=new gs("math","group");return n.mathstyle="\\)"===e?"textstyle":"displaystyle",n.body=this.parse((t=>t===e)),this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.swapParseMode(t),n.body&&0!==n.body.length?n:null}parseModeShift(){let e="";if(this.match("<$>")&&(e="<$>"),!e&&this.match("<$$>")&&(e="<$$>"),!e)return null;const t=new gs("math","group");t.mathstyle="<$>"===e?"textstyle":"displaystyle",t.latexOpen="<$>"===e?"$":"$$",t.latexClose=t.latexOpen;const n=this.swapParseMode("math");return t.body=this.parse((t=>t===e)),this.match(e)||this.onError({code:"unbalanced-mode-shift"}),this.swapParseMode(n),t.body&&0!==t.body.length?t:null}parseEnvironment(){if(!this.match("\\begin"))return null;const e=this.parseArgument("string");if(!e)return null;const t=wa(e);if(!t)return this.onError({code:"unknown-environment",arg:e}),null;const n=[];if(null==t?void 0:t.params)for(const r of t.params)if(r.isOptional)n.push(this.parseOptionalArgument(r.type));else{const t=this.parseArgument(r.type);t||this.onError({code:"missing-argument",arg:e}),n.push(t)}const r=this.parseMode,o=this.tabularMode,i=this.swapAtoms([]);this.tabularMode=t.tabular;const a=[],s=[];let l=[],c=!1;do{if(this.end()&&(this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c&&this.match("\\end")&&(this.parseArgument("string")!==e&&this.onError({code:"unbalanced-environment",arg:e}),c=!0),!c)if(this.matchColumnSeparator())l.push(this.swapAtoms([]));else if(this.matchRowSeparator()){l.push(this.swapAtoms([]));let e=0;this.matchWhitespace(),this.match("[")&&(e=this.scanDimen(),this.matchWhitespace(),this.match("]")),s.push(e||0),a.push(l),l=[]}else this.atoms=this.atoms.concat(this.parse((e=>"<}>"===e||"&"===e||"\\end"===e||"\\cr"===e||"\\\\"===e)))}while(!c);l.push(this.swapAtoms([])),l.length>0&&a.push(l);const d=this.swapAtoms(i);if(console.assert(!this.tabularMode||0===d.length,"Leftover atoms in tabular mode"),this.parseMode=r,this.tabularMode=o,!t.tabular&&0===d.length)return null;if(t.tabular&&0===a.length)return null;const u=new gs(this.parseMode,"array",d);return Object.assign(u,t.parser(e,n,a)),u.array=a,u.rowGaps=s,u.environmentName=e,u}parse(e){var t;const n=this.style;e||(e=e=>"<}>"===e);let r="",o=null,i=[],a=null;const s=this.swapAtoms([]);for(;!this.end()&&!e(this.peek());)this.hasInfixCommand()&&!r?(r=this.get(),o=ka(r,"math",this.macros),o&&(i=this.parseArguments(o)[1]),a=this.swapAtoms([])):this.parseToken();let l;return r?(console.assert(Boolean(o)),i.unshift(this.swapAtoms(s)),a&&i.unshift(a),l=[new gs(this.parseMode,o.type,null!==(t=o.value)&&void 0!==t?t:r.slice(1),o.parse?o.parse(r,i):null)],l[0].symbol=r):l=this.swapAtoms(s),this.style=n,l}parseGroup(){if(!this.match("<{>"))return null;const e=new gs(this.parseMode,"group");return e.body=this.parse((e=>"<}>"===e)),this.match("<}>")||this.onError({code:"unbalanced-braces"}),e.latexOpen="{",e.latexClose="}",e}scanSmartFence(){if(this.matchWhitespace(),!this.match("("))return null;const e=new gs(this.parseMode,"leftright");e.leftDelim="(",e.inner=!1;const t=this.swapAtoms([]);let n=1;for(;!this.end()&&0!==n;)this.match("(")&&(n+=1),this.match(")")&&(n-=1),0!==n&&this.parseToken();return 0===n&&this.match(")"),e.rightDelim=0===n?")":"?",e.body=this.swapAtoms(t),e}scanDelim(){this.matchWhitespace();const e=this.get();if(!e)return this.onError({code:"unexpected-end-of-string"}),null;let t=".";("\\"===e[0]||ws(e))&&(t=e);const n=ka(t,"math",this.macros);return n?n.mode&&!n.mode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:t}),null):"mopen"===n.type||"mclose"===n.type||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(t)?t:(this.onError({code:"unexpected-delimiter",arg:t}),null):(this.onError({code:"unknown-command",arg:t}),null)}parseLeftRight(){if(this.match("\\right")||this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),null;const e=this.style;let t="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;t="\\mright"}const n=this.scanDelim();if(!n)return null;const r=this.swapAtoms([]);for(;!this.end()&&!this.match(t);)this.parseToken();this.style=e;const o=this.scanDelim(),i=new gs(this.parseMode,"leftright","",this.style);return i.leftDelim=n,i.rightDelim=null!=o?o:void 0,i.inner="right"===t,i.body=this.swapAtoms(r),i}parseSupSub(){var e,t;if("math"!==this.parseMode)return!1;let n=!1,r=this.peek();for(;"^"===r||"_"===r||"'"===r;){const o="_"===r?"subscript":"superscript";if(this.match("^")||this.match("_")){const t=this.parseArgument("math");if(t){const r=this.lastSubsupAtom();r[o]=(null!==(e=r[o])&&void 0!==e?e:[]).concat(t),n=!0}}else if(this.match("'")){const e=this.lastSubsupAtom(),r=new gs(e.mode,"mord","′");r.symbol="\\prime",e.superscript=null!==(t=e.superscript)&&void 0!==t?t:[],e.superscript.push(r),n=!0}r=this.peek()}return n}parseLimits(){if(this.match("\\limits")){const e=this.lastSubsupAtom();return e.limits="limits",e.explicitLimits=!0,!0}if(this.match("\\nolimits")){const e=this.lastSubsupAtom();return e.limits="nolimits",e.explicitLimits=!0,!0}return!1}parseArguments(e){if(!e||!e.params)return[void 0,[]];let t;const n=[];let r=e.infix?2:0;for(;r")){if("delim"===e)return null!==(t=this.scanDelim())&&void 0!==t?t:".";if(/^(math|text)$/.test(e)){const t=this.swapParseMode(e),n=this.parseSimpleToken();return this.swapParseMode(t),n}}const r=this.parseMode;this.parseMode=e;const o=this.swapAtoms([]);if("string"===e)n=this.scanString(),this.skipUntilToken("<}>");else if("balanced-string"===e)n=this.scanBalancedString(),this.skipUntilToken("<}>");else if("number"===e)n=this.scanNumber(),this.skipUntilToken("<}>");else if("dimen"===e)n=this.scanDimen(),this.skipUntilToken("<}>");else if("skip"===e)n=this.scanSkip(),this.skipUntilToken("<}>");else if("colspec"===e)n=this.scanColspec(),this.skipUntilToken("<}>");else if("color"===e)n=this.scanColor()||"#ffffff",this.skipUntilToken("<}>");else if("delim"===e)n=this.scanDelim()||".",this.skipUntilToken("<}>");else{console.assert(/^(math|text)$/.test(e),'Unexpected parse mode: "'+e+'"');const t=this.index;let r=1;do{const e=this.get();"<}>"===e&&(r-=1),"<{>"===e&&(r+=1)}while(r>0&&!this.end());if(n=function(e,t,n,r){var o;return(null===(o=Ii[e])||void 0===o?void 0:o.parse)?Ii[e].parse(t,n,r):null}(e,this.tokens.slice(t,this.index-1),this.onError,{args:this.args,macros:this.macros,smartFence:this.smartFence,style:this.style,parse:(e,t,r)=>{const o=new ks(t,r.args,r.macros,this.onError);return o.parseMode=e,o.style=r.style,n=o.parse(),[n,t.slice(o.index)]}}),!n){this.index=t;do{this.atoms=this.atoms.concat(this.parse())}while(!this.match("<}>")&&!this.end())}}this.parseMode=r;const i=this.swapAtoms(o);return null!=n?n:i}parseOptionalArgument(e){var t;if(e="auto"===e?this.parseMode:e,this.matchWhitespace(),!this.match("["))return null;const n=this.parseMode;this.parseMode=e;const r=this.swapAtoms();let o;for(;!this.end()&&!this.match("]");)if("string"===e)o=this.scanString();else if("number"===e)o=this.scanNumber();else if("dimen"===e)o=this.scanDimen();else if("skip"===e)o=this.scanSkip();else if("colspec"===e)o=this.scanColspec();else if("color"===e)o=null!==(t=this.scanColor())&&void 0!==t?t:"#ffffff";else if("bbox"===e){const e=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/),t={};for(const n of e){const e=Na(n);if(e)t.backgroundcolor=e;else{const e=n.match(/^\s*([0-9.]+)\s*([a-z][a-z])/);if(e)t.padding=Ei(e[1],e[2]);else{const e=n.match(/^\s*border\s*:\s*(.*)/);e&&(t.border=e[1])}}}o=t}else console.assert("math"===e,'Unexpected parse mode: "'+e+'"'),this.atoms=this.atoms.concat(this.parse((e=>"]"===e)));this.parseMode=n;const i=this.swapAtoms(r);return null!=o?o:i}parseSimpleToken(){const e=this.get();if(!e)return null;let t=null;if(""===e)"text"===this.parseMode&&(t=new gs("text",""," ",this.style),t.symbol=" ");else if("\\"===e[0]){if("\\placeholder"===e)t=new gs(this.parseMode,"placeholder",this.parseArgument("string"),this.style),t.captureSelection=!0;else if("\\char"===e){const e=this.index;let n=Math.floor(this.scanNumber(!0));(!isFinite(n)||n<0||n>1114111)&&(n=10067),t=new gs(this.parseMode,"math"===this.parseMode?"mord":"",String.fromCodePoint(n)),t.symbol="\\char",t.latex="\\char"+ds(this.tokens.slice(e,this.index))}else if("\\hskip"===e||"\\kern"===e){const n=this.scanSkip();isFinite(n)&&(t=new gs(this.parseMode,"spacing",null,this.style),t.width=n,t.symbol=e,t.latex=e)}else if(t=this.scanMacro(e),!t){const n=ka(e,this.parseMode,{});if(!n)return this.onError({code:"unknown-command",arg:e}),t=new gs("math","error",e),t.symbol=e,t.latex=e,[t];if(n.mode&&!n.mode.includes(this.parseMode))return this.onError({code:"invalid-command",arg:e}),t=new gs("math","error",e),t.symbol=e,t.latex=e,[t];const r=this.index,[o,i]=this.parseArguments(n);if(!i)return null;if(n.infix)this.onError({code:"too-many-infix-commands",arg:e});else{if(n.parse){const r=n.parse(e,i);if(r.type)t=new gs(this.parseMode,n.type,o?this.parseArgument(o):null,{...this.style,...r});else{const e=this.parseMode;if(r.mode&&(this.parseMode=r.mode,delete r.mode),r.mathstyle){this.parseMode="math";const e=new gs("math","mathstyle");e.mathstyle=r.mathstyle,this.atoms.push(e)}if(o){const e=this.style;this.style={...this.style,...r},t=this.parseArgument(o),this.style=e}else this.style={...this.style,...r};this.parseMode=e}}else{const r={...this.style,variant:n.variant||this.style.variant,variantStyle:n.variantStyle||this.style.variantStyle};t=new gs(this.parseMode,n.type||"mop",n.value||e,r)}if(t instanceof gs&&!/^\\(llap|rlap|class|cssId)$/.test(e)){t.symbol=e;const n=ds(this.tokens.slice(r,this.index));if(n&&(t.latex=t.symbol+n),t.isFunction&&this.smartFence){const e=this.scanSmartFence();e&&(t=[t,e])}}}}}else if(ws(e)){const n=ka(e,this.parseMode,this.macros);if(n){const r={...this.style};t=new gs(this.parseMode,n.type,n.value||e,r),n.isFunction&&(t.isFunction=!0)}else t=new gs(this.parseMode,"math"===this.parseMode?"mord":"",e,this.style);if(t.symbol=e,t.latex=ya(this.parseMode,e),(null==n?void 0:n.isFunction)&&this.smartFence){const e=this.scanSmartFence();e&&(t=[t,e])}}else"<}>"===e?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:e});return t&&!si(t)?[t]:t}scanMacro(e){var t;const n=e.slice(1);if(!this.macros||!this.macros[n])return null;const r=this.index,o=[];let i,a=0;"string"==typeof this.macros[n]?(i=this.macros[n],/(^|[^\\])#1/.test(i)&&(a=1),/(^|[^\\])#2/.test(i)&&(a=2),/(^|[^\\])#3/.test(i)&&(a=3),/(^|[^\\])#4/.test(i)&&(a=4),/(^|[^\\])#5/.test(i)&&(a=5),/(^|[^\\])#6/.test(i)&&(a=6),/(^|[^\\])#7/.test(i)&&(a=7),/(^|[^\\])#8/.test(i)&&(a=8),/(^|[^\\])#9/.test(i)&&(a=9)):(i=this.macros[n].def,a=this.macros[n].args||0);for(let e=1;e<=a;e++)o[e]=this.matchLiteralArg();o["?"]=null===(t=this.args)||void 0===t?void 0:t["?"];const s=new gs(this.parseMode,"group",_s(i,this.parseMode,o,this.macros,!1,this.onError));return s.captureSelection=!0,s.symbol=e,s.latex=e+ds(this.tokens.slice(r,this.index)),s}parseToken(){let e=this.parseEnvironment()||this.parseModeShift()||this.parseModeSet()||this.parseGroup()||this.parseLeftRight();return!(e||!this.parseSupSub()&&!this.parseLimits())||(e||(e=this.parseSimpleToken()),si(e)?this.atoms=this.atoms.concat(e):e&&this.atoms.push(e),null!==e)}}function _s(e,t,n,r,o=!1,i){let a=[];const s=new ks(ls(e,n),n,r,(t=>{"function"==typeof i&&i({...t,latex:e})}));for(s.parseMode=t||"math",o&&(s.smartFence=!0);!s.end();){const e=s.parse();e&&(a=a.concat(e))}return a}var Ms,Ss;const Es=null!==(Ss=null===(Ms=document.currentScript)||void 0===Ms?void 0:Ms.src)&&void 0!==Ss?Ss:function(){const e=String((new Error).stack).replace(/^Error.*\n/,"").split("\n");if(0===e.length)return"";const t=e[0].match(/http.*js/);return t?t[0]:""}();function zs(e,t){var n,r;if(!t)return null;let o=null!==(n=null==e?void 0:e.getRootNode())&&void 0!==n?n:null===document||void 0===document?void 0:document.head;if(!o)return null;o===document&&(o=document.head);const i=function(e){let t=0;if(0===e.length)return t;for(let n=0;n{var e;const t=document.head.querySelector(`style[data-id="${i}"]`);if(t){const n=parseFloat(null!==(e=t.getAttribute("data-refcount"))&&void 0!==e?e:"0");1===n?t.remove():t.setAttribute("data-refcount",Number(n-1).toString())}}}}function Cs(e){return 0===e.length||1===e.length&&"first"===e[0].type}function Ls(e){const t=e.siblings();for(let e=t.length-1;e>=0;e--)t[e].isSuggestion&&t.splice(e,1)}function Os(e){let t=1,n=e.ancestor(t);for(;n;)n.latex=void 0,t+=1,n=e.ancestor(t)}function Ts(e,t){const n={...t},r=e.lastPosition;return n.start<0?n.start=Math.max(0,r+n.start+1):isNaN(n.start)?n.start=0:n.start=Math.min(n.start,r),n.end<0?n.end=Math.max(0,r+n.end+1):isNaN(n.end)?n.end=n.start:n.end=Math.min(n.end,r),n.start1&&(t.extent=parseInt(n[1]));const r=n[0].split("/");for(const e of r){const n=e.match(/([^:]*):(.*)/);n&&t.path.push({relation:n[1],offset:parseInt(n[2])})}return t}function Ps(e,t){let n=0,r=-1,o=!1;for(;!o;)r+=1,o=r>=e.length||r>=t.length,o=o||!(e[r].relation===t[r].relation&&e[r].offset===t[r].offset);return n=r===e.length&&r===t.length?0:r+1===e.length&&r+1===t.length&&e[r].relation===t[r].relation?1:2,n}function Is(e){return Ds(As(e)).path}function Ns(e,t){let n=0;for(let r=0;r0;)r.col+=1,(!e[r.row]||r.col>=e[r.row].length)&&(r.col=0,r.row+=1),n-=1;return r}function Bs(e,t,n=!0){var r;let o;return"object"!=typeof t&&(t=Rs(e,t)),si(e[t.row])&&(o=null!==(r=e[t.row][t.col])&&void 0!==r?r:null),n&&o&&(0===o.length||"first"!==o[0].type)&&o.unshift(new gs("math","first")),o}function js(e){let t=0,n=0,r=1;for(const t of e)n+=1,t.length>r&&(r=t.length);return t=n*r,t}function $s(e,t,n){const r={...t};if(r.row+=n,r.row<0){if(r.col+=n,r.row=e.length-1,r.col<0)return null;for(;r.row>=0&&!Bs(e,r);)r.row-=1;if(r.row<0)return null}else if(r.row>=e.length){for(r.col+=n,r.row=0;r.rowe.length-1)return null}return r}const Ks={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML_bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},qs={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[0-9A-Z ]$/,fraktur:/^[0-9A-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/,"sans-serif":/^[0-9A-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039b\u039e\u03A0\u03A3\u03A5\u03A8\u03a9]$/},Fs=/^[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5]$/,Hs=[/^[a-z]$/,/^[A-Z]$/,Fs,/^[\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9]$/],Ws={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]};function Vs(e,t,n){return cs(Pi(t,"fontSize").map((e=>{const t=function(e,t){return cs(Pi(t,"fontSeries").map((e=>{const t=function(e,t){return cs(Pi(t,"fontShape").map((e=>{const t=function(e,t){let n=!1;return cs(t.map((e=>{let t="",r="";return e.latex?t=e.latex:"string"==typeof e.body?t=va("text",e.body):e.symbol&&(t=e.symbol.replace(/\\/g,"\\backslash ")),!n||t&&!/^[a-zA-Z0-9*]/.test(t)||(r="{}"),n=/\\[a-zA-Z0-9]+\*?$/.test(t),r+t})))}(0,e);return"it"===e[0].fontShape?"\\textit{"+t+"}":"sl"===e[0].fontShape?"\\textsl{"+t+"}":"sc"===e[0].fontShape?"\\textsc{"+t+"}":"n"===e[0].fontShape?"\\textup{"+t+"}":e[0].fontShape?"\\fontshape{"+e[0].fontShape+"}"+t:t})))}(0,e);return"b"===e[0].fontSeries?"\\textbf{"+t+"}":"l"===e[0].fontSeries?"\\textlf{"+t+"}":"m"===e[0].fontSeries?"\\textmd{"+t+"}":e[0].fontSeries?"\\fontseries{"+e[0].fontSeries+"}"+t:t})))}(0,e),n={size1:"tiny",size2:"scriptsize",size3:"footnotesize",size4:"small",size5:"normalsize",size6:"large",size7:"Large",size8:"LARGE",size9:"huge",size10:"Huge"}[e[0].fontSize]||"";return n?"\\"+n+" "+t:t})))}Ni("math",{emitLatexRun:function(e,t,n){let r=e.variant;return e.variantStyle&&"up"!==e.variantStyle&&(r+="-"+e.variantStyle),cs(Pi(t,"color").map((t=>{const o=cs(Pi(t,"variant").map((t=>{let o=t[0].variant;if(t[0].variantStyle&&"up"!==t[0].variantStyle&&(o+="-"+t[0].variantStyle),t.every((t=>{const n=ka(t.symbol,e.mode,null);if(!n||!n.variant&&!n.variantStyle)return!1;let r=t.variant;return t.variantStyle&&"up"!==t.variantStyle&&(r+="-"+t.variantStyle),r===o})))return cs(t.map((e=>e.toLatex(n))));let i="";return o&&o!==r&&(i={calligraphic:"\\mathcal{",fraktur:"\\mathfrak{","double-struck":"\\mathbb{",script:"\\mathscr{",monospace:"\\mathtt{","sans-serif":"\\mathsf{",normal:"\\mathrm{","normal-italic":"\\mathit{","normal-bold":"\\mathbf{","normal-bolditalic":"\\mathbfit{",ams:"","ams-italic":"\\mathit{","ams-bold":"\\mathbf{","ams-bolditalic":"\\mathbfit{",main:"","main-italic":"\\mathit{","main-bold":"\\mathbf{","main-bolditalic":"\\mathbfit{"}[o],console.assert(void 0!==i)),i+cs(t.map((e=>e.toLatex(n))))+(i?"}":"")})));return!t[0].color||e&&e.color===t[0].color?o:"\\textcolor{"+Ra(t[0].color)+"}{"+o+"}"})))},applyStyle:function(e,t){const n="auto"!==t.letterShapeStyle&&t.letterShapeStyle?t.letterShapeStyle:"tex";let r=t.variant||"normal",o=t.variantStyle||"";"normal"===r&&!o&&/\u00a3|\u0131|\u0237/.test(e.body)&&(r="main",o="italic"),"normal"!==r||o||1!==e.body.length||Hs.forEach(((t,r)=>{t.test(e.body)&&"it"===Ws[n][r]&&(o="italic")})),"up"===o&&(o="");const i=o?r+"-"+o:r;console.assert(Ks[i]);const[a,s]=Ks[i];return qs[r]&&!qs[r].test(e.body)?(e.body=ga(e.body,r,o),e.variant="",e.variantStyle="",null):(Fs.test(e.body)&&(e.classes+=" lcGreek"),s&&(e.classes+=" "+s),a)}});const Us={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"};Ni("text",{emitLatexRun:function(e,t,n){const r=function(e,t){return cs(Pi(t,"color").map((t=>{const n=function(e,t){return function(e,t){return cs(Pi(t,"fontFamily").map((e=>{const t=Vs(0,e),n={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[e[0].fontFamily]||"";return n?"\\"+n+"{"+t+"}":e[0].fontFamily?"\\fontfamily{"+e[0].fontFamily+"}"+t:t})))}(0,t)}(0,t);return!t[0].color||"none"===t[0].color||e&&e.color===t[0].color?n:"\\textcolor{"+Ra(t[0].color)+"}{"+n+"}"})))}(e,t);return t.every((e=>e.fontSeries||e.fontShape||e.fontFamily))&&t[0].mode===e.mode?r:`\\text{${r}}`},applyStyle:function(e,t){const n=t.fontFamily;if(Us[n]?e.classes+=" "+Us[n]:n&&e.setStyle("font-family",n),t.fontShape&&(e.classes+=" "+({it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[t.fontShape]||"")),t.fontSeries){const n=t.fontSeries.match(/(.?[lbm])?(.?[cx])?/);n&&(e.classes+=" "+({ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[n[1]||""]||""),e.classes+=" "+({uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[n[2]||""]||""))}return"Main-Regular"},parse:(e,t,n)=>function(e,t,n){let r,o=[];for(;e.length>0;){const i=e.shift();if(""===i)r=new gs("text",""," ",n.style),r.symbol=" ",o.push(r);else if("\\"===i[0]){let t;e.unshift(i),[t,e]=n.parse("text",e,n),o=[...o,...t]}else if("<$>"===i||"<$$>"===i){const t=e.slice(0,e.findIndex((e=>e===i)));e=e.slice(t.length+1);const[r]=n.parse("math",t,n);o=[...o,...r]}else if("<{>"===i||"<}>"===i);else{const e=ka(i,"text",n.macros);!e||e.mode&&!e.mode.includes("text")?t({code:"unexpected-token"}):(r=new gs("text",e?e.type:"",e?e.value:i,n.style),r.symbol=i,r.latex=ha("text",i),o.push(r))}}return[o,e]}(e,t,n)[0]}),La(["ce","pu"],"{chemformula:balanced-string}",null,((e,t)=>({type:"group",mode:"chem",body:_s(Gs.go(Zs.go(t[0],"\\pu"===e?"pu":"ce"))),latexOpen:"\\"+e+"{",latexClose:"}"})));var Zs={go:function(e,t){if(!e)return[];void 0===t&&(t="ce");var n,r="0",o={parenthesisLevel:0};e=(e=(e=e.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var i=10,a=[];;){n!==e?(i=10,n=e):i--;var s=Zs.stateMachines[t],l=s.transitions[r]||s.transitions["*"];e:for(var c=0;c0))return a;if(u.revisit||(e=d.remainder),!u.toContinue)break e}}if(i<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e,t){if(t)if(Array.isArray(t))for(var n=0;n":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(e){return Zs.patterns.findObserveGroups(e,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(e){return Zs.patterns.findObserveGroups(e,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(e){return Zs.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(e){return Zs.patterns.findObserveGroups(e,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(e){return Zs.patterns.findObserveGroups(e,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(e){return Zs.patterns.findObserveGroups(e,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(e){return Zs.patterns.findObserveGroups(e,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(e){return Zs.patterns.findObserveGroups(e,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(e){return Zs.patterns.findObserveGroups(e,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(e){return Zs.patterns.findObserveGroups(e,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(e){return Zs.patterns.findObserveGroups(e,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(e){return Zs.patterns.findObserveGroups(e,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(e){var t;if(t=e.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:t[0],remainder:e.substr(t[0].length)};var n=Zs.patterns.findObserveGroups(e,"","$","$","");return n&&(t=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:t[0],remainder:e.substr(t[0].length)}:null},amount2:function(e){return this.amount(e)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(e){if(e.match(/^\([a-z]+\)$/))return null;var t=e.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return t?{match_:t[0],remainder:e.substr(t[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(e,t,n,r,o,i,a,s,l,c){var d=function(e,t){if("string"==typeof t)return 0!==e.indexOf(t)?null:t;var n=e.match(t);return n?n[0]:null},u=d(e,t);if(null===u)return null;if(e=e.substr(u.length),null===(u=d(e,n)))return null;var p=function(e,t,n){for(var r=0;t":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(e,t){var n;if((e.d||"").match(/^[0-9]+$/)){var r=e.d;e.d=void 0,n=this.output(e),e.b=r}else n=this.output(e);return Zs.actions["o="](e,t),n},"d= kv":function(e,t){e.d=t,e.dType="kv"},"charge or bond":function(e,t){if(e.beginsWithBond){var n=[];return Zs.concatArray(n,this.output(e)),Zs.concatArray(n,Zs.actions.bond(e,t,"-")),n}e.d=t},"- after o/d":function(e,t,n){var r=Zs.patterns.match_("orbital",e.o||""),o=Zs.patterns.match_("one lowercase greek letter $",e.o||""),i=Zs.patterns.match_("one lowercase latin letter $",e.o||""),a=Zs.patterns.match_("$one lowercase latin letter$ $",e.o||""),s="-"===t&&(r&&""===r.remainder||o||i||a);!s||e.a||e.b||e.p||e.d||e.q||r||!i||(e.o="$"+e.o+"$");var l=[];return s?(Zs.concatArray(l,this.output(e)),l.push({type_:"hyphen"})):(r=Zs.patterns.match_("digits",e.d||""),n&&r&&""===r.remainder?(Zs.concatArray(l,Zs.actions["d="](e,t)),Zs.concatArray(l,this.output(e))):(Zs.concatArray(l,this.output(e)),Zs.concatArray(l,Zs.actions.bond(e,t,"-")))),l},"a to o":function(e){e.o=e.a,e.a=void 0},"sb=true":function(e){e.sb=!0},"sb=false":function(e){e.sb=!1},"beginsWithBond=true":function(e){e.beginsWithBond=!0},"beginsWithBond=false":function(e){e.beginsWithBond=!1},"parenthesisLevel++":function(e){e.parenthesisLevel++},"parenthesisLevel--":function(e){e.parenthesisLevel--},"state of aggregation":function(e,t){return{type_:"state of aggregation",p1:Zs.go(t,"o")}},comma:function(e,t){var n=t.replace(/\s*$/,"");return n!==t&&0===e.parenthesisLevel?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(e,t,n){var r,o,i;for(var a in e.r?(o="M"===e.rdt?Zs.go(e.rd,"tex-math"):"T"===e.rdt?[{type_:"text",p1:e.rd||""}]:Zs.go(e.rd),i="M"===e.rqt?Zs.go(e.rq,"tex-math"):"T"===e.rqt?[{type_:"text",p1:e.rq||""}]:Zs.go(e.rq),r={type_:"arrow",r:e.r,rd:o,rq:i}):(r=[],(e.a||e.b||e.p||e.o||e.q||e.d||n)&&(e.sb&&r.push({type_:"entitySkip"}),e.o||e.q||e.d||e.b||e.p||2===n?e.o||e.q||e.d||!e.b&&!e.p?e.o&&"kv"===e.dType&&Zs.patterns.match_("d-oxidation$",e.d||"")?e.dType="oxidation":e.o&&"kv"===e.dType&&!e.q&&(e.dType=void 0):(e.o=e.a,e.d=e.b,e.q=e.p,e.a=e.b=e.p=void 0):(e.o=e.a,e.a=void 0),r.push({type_:"chemfive",a:Zs.go(e.a,"a"),b:Zs.go(e.b,"bd"),p:Zs.go(e.p,"pq"),o:Zs.go(e.o,"o"),q:Zs.go(e.q,"pq"),d:Zs.go(e.d,"oxidation"===e.dType?"oxidation":"bd"),dType:e.dType}))),e)"parenthesisLevel"!==a&&"beginsWithBond"!==a&&delete e[a];return r},"oxidation-output":function(e,t){var n=["{"];return Zs.concatArray(n,Zs.go(t,"oxidation")),n.push("}"),n},"frac-output":function(e,t){return{type_:"frac-ce",p1:Zs.go(t[0]),p2:Zs.go(t[1])}},"overset-output":function(e,t){return{type_:"overset",p1:Zs.go(t[0]),p2:Zs.go(t[1])}},"underset-output":function(e,t){return{type_:"underset",p1:Zs.go(t[0]),p2:Zs.go(t[1])}},"underbrace-output":function(e,t){return{type_:"underbrace",p1:Zs.go(t[0]),p2:Zs.go(t[1])}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:Zs.go(t[1])}},"r=":function(e,t){e.r=t},"rdt=":function(e,t){e.rdt=t},"rd=":function(e,t){e.rd=t},"rqt=":function(e,t){e.rqt=t},"rq=":function(e,t){e.rq=t},operator:function(e,t,n){return{type_:"operator",kind_:n||t}}}},a:{transitions:Zs.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:Zs.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:Zs.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(e){if(e.text_){var t={type_:"text",p1:e.text_};for(var n in e)delete e[n];return t}}}},pq:{transitions:Zs.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(e,t){return{type_:"state of aggregation subscript",p1:Zs.go(t,"o")}},"color-output":function(e,t){return{type_:"color",color1:t[0],color2:Zs.go(t[1],"pq")}}}},bd:{transitions:Zs.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(e,t){return{type_:"color",color1:t[0],color2:Zs.go(t[1],"bd")}}}},oxidation:{transitions:Zs.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(e,t){return{type_:"roman numeral",p1:t||""}}}},"tex-math":{transitions:Zs.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"tex-math tight":{transitions:Zs.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(e,t){e.o=(e.o||"")+"{"+t+"}"},output:function(e){if(e.o){var t={type_:"tex-math",p1:e.o};for(var n in e)delete e[n];return t}}}},"9,9":{transitions:Zs.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:Zs.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(e,t){var n=[];return"+-"===t[0]||"+/-"===t[0]?n.push("\\pm "):t[0]&&n.push(t[0]),t[1]&&(Zs.concatArray(n,Zs.go(t[1],"pu-9,9")),t[2]&&(t[2].match(/[,.]/)?Zs.concatArray(n,Zs.go(t[2],"pu-9,9")):n.push(t[2])),t[3]=t[4]||t[3],t[3]&&(t[3]=t[3].trim(),"e"===t[3]||"*"===t[3].substr(0,1)?n.push({type_:"cdot"}):n.push({type_:"times"}))),t[3]&&n.push("10^{"+t[5]+"}"),n},"number^":function(e,t){var n=[];return"+-"===t[0]||"+/-"===t[0]?n.push("\\pm "):t[0]&&n.push(t[0]),Zs.concatArray(n,Zs.go(t[1],"pu-9,9")),n.push("^{"+t[2]+"}"),n},operator:function(e,t,n){return{type_:"operator",kind_:n||t}},space:function(){return{type_:"pu-space-1"}},output:function(e){var t,n=Zs.patterns.match_("{(...)}",e.d||"");n&&""===n.remainder&&(e.d=n.match_);var r=Zs.patterns.match_("{(...)}",e.q||"");if(r&&""===r.remainder&&(e.q=r.match_),e.d&&(e.d=e.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.d=e.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),e.q){e.q=e.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),e.q=e.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var o={d:Zs.go(e.d,"pu"),q:Zs.go(e.q,"pu")};"//"===e.o?t={type_:"pu-frac",p1:o.d,p2:o.q}:(t=o.d,o.d.length>1||o.q.length>1?t.push({type_:" / "}):t.push({type_:"/"}),Zs.concatArray(t,o.q))}else t=Zs.go(e.d,"pu-2");for(var i in e)delete e[i];return t}}},"pu-2":{transitions:Zs.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(e,t){e.rm+="^{"+t+"}"},space:function(){return{type_:"pu-space-2"}},output:function(e){var t=[];if(e.rm){var n=Zs.patterns.match_("{(...)}",e.rm||"");t=n&&""===n.remainder?Zs.go(n.match_,"pu"):{type_:"rm",p1:e.rm}}for(var r in e)delete e[r];return t}}},"pu-9,9":{transitions:Zs.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){var n=e.text_.length%3;0===n&&(n=3);for(var r=e.text_.length-3;r>0;r-=3)t.push(e.text_.substr(r,3)),t.push({type_:"1000 separator"});t.push(e.text_.substr(0,n)),t.reverse()}else t.push(e.text_);for(var o in e)delete e[o];return t},"output-o":function(e){var t=[];if(e.text_=e.text_||"",e.text_.length>4){for(var n=e.text_.length-3,r=0;r":case"→":case"⟶":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<--\x3e":return"rightleftarrows";case"<=>":case"⇌":return"rightleftharpoons";case"<=>>":return"rightequilibrium";case"<<=>":return"leftequilibrium";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(e){switch(e){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";case"~=":case"~--":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"-~-":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(e){switch(e){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};const Xs={"''":{mode:"math",value:"^{\\doubleprime}"},alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:{mode:"math",value:"\\pi"},"pi ":{mode:"text",value:"\\pi "},Pi:{mode:"math",value:"\\Pi"},theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:{mode:"math",value:"\\nabla"},grad:{mode:"math",value:"\\nabla"},del:{mode:"math",value:"\\partial"},"∞":"\\infty",oo:{mode:"math",after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"∑":{mode:"math",value:"\\sum"},sum:{mode:"math",value:"\\sum_{#?}^{#?}"},prod:{mode:"math",value:"\\prod_{#?}^{#?}"},sqrt:{mode:"math",value:"\\sqrt{#?}"},"∆":{mode:"math",value:"\\differentialD"},"∂":{mode:"math",value:"\\differentialD"},arcsin:{mode:"math",value:"\\arcsin"},arccos:{mode:"math",value:"\\arccos"},arctan:{mode:"math",value:"\\arctan"},sin:{mode:"math",value:"\\sin"},sinh:{mode:"math",value:"\\sinh"},cos:{mode:"math",value:"\\cos"},cosh:{mode:"math",value:"\\cosh"},tan:{mode:"math",value:"\\tan"},tanh:{mode:"math",value:"\\tanh"},sec:{mode:"math",value:"\\sec"},csc:{mode:"math",value:"\\csc"},cot:{mode:"math",value:"\\cot"},log:{mode:"math",value:"\\log"},ln:{mode:"math",value:"\\ln"},exp:{mode:"math",value:"\\exp"},lim:{mode:"math",value:"\\lim_{#?}"},dx:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:{mode:"math",value:"\\forall"},EE:{mode:"math",value:"\\exists"},"!EE":{mode:"math",value:"\\nexists"},"&&":{mode:"math",value:"\\land"},xin:{mode:"math",after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},in:{mode:"math",after:"nothing+letter+closefence",value:"\\in"},"!in":{mode:"math",value:"\\notin"},NN:"\\N",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",PP:"\\P",xx:{mode:"math",value:"\\times"},"+-":{mode:"math",value:"\\pm"},"!=":{mode:"math",value:"\\ne"},">=":{mode:"math",value:"\\ge"},"<=":{mode:"math",value:"\\le"},"<<":{mode:"math",value:"\\ll"},">>":{mode:"math",value:"\\gg"},"~~":{mode:"math",value:"\\approx"},"≈":{mode:"math",value:"\\approx"},"?=":{mode:"math",value:"\\questeq"},"÷":{mode:"math",value:"\\div"},"¬":{mode:"math",value:"\\neg"},":=":{mode:"math",value:"\\coloneq"},"::":{mode:"math",value:"\\Colon"},"(:":{mode:"math",value:"\\langle"},":)":{mode:"math",value:"\\rangle"},beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},"eta ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta "},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},"mu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu "},nu:{mode:"math",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},"nu ":{mode:"text",after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu "},"µ":"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega","Ω":"\\omega",forall:{mode:"math",value:"\\forall"},exists:{mode:"math",value:"\\exists"},"!exists":{mode:"math",value:"\\nexists"},":.":{mode:"math",value:"\\therefore"},liminf:"\\operatorname*{lim~inf}_{#?}",limsup:"\\operatorname*{lim~sup}_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:{mode:"math",value:"\\mod"},max:{mode:"math",value:"\\max"},min:{mode:"math",value:"\\min"},erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:{mode:"math",value:"\\operatorname{bessel}"},mean:{mode:"math",value:"\\operatorname{mean}"},median:{mode:"math",value:"\\operatorname{median}"},fft:{mode:"math",value:"\\operatorname{fft}"},lcm:{mode:"math",value:"\\operatorname{lcm}"},gcd:{mode:"math",value:"\\operatorname{gcd}"},randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:{mode:"math",value:"\\operatorname{Re}"},Im:{mode:"math",value:"\\operatorname{Im}"},mm:{mode:"math",after:"nothing+digit",value:"\\operatorname{mm}"},cm:{mode:"math",after:"nothing+digit",value:"\\operatorname{cm}"},km:{mode:"math",after:"nothing+digit",value:"\\operatorname{km}"},kg:{mode:"math",after:"nothing+digit",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","->":"\\to","|->":"\\mapsto","--\x3e":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","{":"\\{","}":"\\}","*":"\\cdot"};function Ys(e,t,n){var r;return function(e,t){if(!t)return"";if("string"==typeof t)return t;if(!e)return t.value;let n=!1,r=!1,o=!1,i=!1,a=!1,s=!1,l=!1,c=!1,d=!1,u=!1,p=!1,h=!1,f=!1,m=!1,g=e[e.length-1],y=e.length-1;for(;g&&/msubsup|placeholder/.test(g.type);)y-=1,g=e[y];if(n=!g||"first"===g.type,g){if(void 0!==t.mode&&g.mode!==t.mode)return"";f="text"===g.mode,r=!f&&"mord"===g.type&&ca.test(g.body),o=!f&&"mord"===g.type&&/[0-9]+$/.test(g.body),i=!f&&g.isFunction,a="genfrac"===g.type,s="surd"===g.type,l="mbin"===g.type,c="mrel"===g.type,d="mpunct"===g.type||"minner"===g.type,u=Boolean(g.array),p="mopen"===g.type,h="mclose"===g.type||"leftright"===g.type,m="space"===g.type}return void 0!==t.after?/nothing/.test(t.after)&&n||/letter/.test(t.after)&&r||/digit/.test(t.after)&&o||/function/.test(t.after)&&i||/frac/.test(t.after)&&a||/surd/.test(t.after)&&s||/binop/.test(t.after)&&l||/relop/.test(t.after)&&c||/punct/.test(t.after)&&d||/array/.test(t.after)&&u||/openfence/.test(t.after)&&p||/closefence/.test(t.after)&&h||/text/.test(t.after)&&f||/space/.test(t.after)&&m?t.value:"":t.value}(e,null!==(r=null==n?void 0:n[t])&&void 0!==r?r:Xs[t])}function Js(e,t){if(!e)return["latex",""];if(e.length<=1)return["latex",e];if(!t||"ASCIIMath"!==t.format){const t=e.trim();if(t.startsWith("$$")&&t.endsWith("$$")||t.startsWith("\\[")&&t.endsWith("\\]")||t.startsWith("\\(")&&t.endsWith("\\)"))return["latex",t.substring(2,t.length-2)];if(t.startsWith("$")&&t.endsWith("$"))return["latex",t.substring(1,t.length-1)];if(e=e.replace(/\\\\([^\s\n])/g,"\\$1"),/\\/.test(e))return["latex",e]}return e=(e=(e=(e=(e=(e=e.replace(/\u2061/gu,"")).replace(/\u3016/gu,"{")).replace(/\u3017/gu,"}")).replace(/([^\\])sinx/g,"$1\\sin x")).replace(/([^\\])cosx/g,"$1\\cos x ")).replace(/\u2013/g,"-"),[(null==t?void 0:t.format)||"ASCIIMath",Qs(e,null!=t?t:{})]}function Qs(e,t){var n,r,o,i,a,s,l;if(!e)return"";let c,d=!1;if(d||"^"!==e[0]&&"_"!==e[0]||(c=el(e.substr(1),{inlineShortcuts:null!==(n=null==t?void 0:t.inlineShortcuts)&&void 0!==n?n:{},noWrap:!0}),e=e[0]+"{"+c.match+"}",e+=Qs(c.rest,t),d=!0),!d&&(c=e.match(/^(sqrt|\u221a)(.*)/),c)&&(c=el(c[2],{inlineShortcuts:null!==(r=null==t?void 0:t.inlineShortcuts)&&void 0!==r?r:{},noWrap:!0}),e="\\sqrt{"+(c.match||"\\placeholder{}")+"}",e+=Qs(c.rest,t),d=!0),!d&&(c=e.match(/^(\\cbrt|\u221b)(.*)/),c)&&(c=el(c[2],{inlineShortcuts:null!==(o=null==t?void 0:t.inlineShortcuts)&&void 0!==o?o:{},noWrap:!0}),e="\\sqrt[3]{"+(c.match||"\\placeholder{}")+"}",e+=Qs(c.rest,t),d=!0),d||(c=e.match(/^abs(.*)/),c&&(c=el(c[1],{inlineShortcuts:null!==(i=null==t?void 0:t.inlineShortcuts)&&void 0!==i?i:{},noWrap:!0}),e="\\left|"+c.match+"\\right|",e+=Qs(c.rest,t),d=!0)),d||(c=e.match(/^["”“](.*?)["”“](.*)/),c&&(e="\\text{"+c[1]+"}",e+=Qs(c[2],t),d=!0)),d||(c=e.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/),c&&(e=tl(c[1],t),e+=Qs(c[2],t),d=!0)),!d&&/^(f|g|h)[^a-zA-Z]/.test(e)&&(c=el(e.substring(1),{inlineShortcuts:null!==(a=t.inlineShortcuts)&&void 0!==a?a:{},noWrap:!0}),e="("===e[1]?e[0]+"\\mleft("+c.match+"\\mright)":e[0]+c.match,e+=Qs(c.rest,t),d=!0),d||(c=e.match(/^([a-zA-Z]+)(.*)/),c&&(e=tl(c[1],t),e+=Qs(c[2],t),d=!0)),!d)if(c=el(e,{inlineShortcuts:null!==(s=t.inlineShortcuts)&&void 0!==s?s:{},noWrap:!0}),c.match&&"/"===c.rest[0]){const n=el(c.rest.substr(1),{inlineShortcuts:null!==(l=t.inlineShortcuts)&&void 0!==l?l:{},noWrap:!0});n.match&&(e="\\frac{"+c.match+"}{"+n.match+"}"+Qs(n.rest,t)),d=!0}else c.match&&(e="("===e[0]?"\\left("+c.match+"\\right)"+Qs(c.rest,t):c.match+Qs(c.rest,t),d=!0);return d||(c=e.match(/^(\s+)(.*)$/),c&&(e=" "+Qs(c[2],t),d=!0)),e}function el(e,t){let n="",r=e=e.trim(),o=e.charAt(0),i={"(":")","{":"}","[":"]"}[o];if(i){let a=1,s=1;for(;s0;)e[s]===o&&a++,e[s]===i&&a--,s++;0===a?(t.noWrap&&"("===o?n=Qs(e.substring(1,s-1),t):("{"===o&&"}"===i&&(o="\\{",i="\\}"),n="\\left"+o+Qs(e.substring(1,s-1),t)+"\\right"+i),r=e.substring(s)):(n=e.substring(1,s),r="")}else{let o=e.match(/^([a-zA-Z]+)/);if(o){let n=Ys(null,e,t.inlineShortcuts);if(n)return n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),{match:n,rest:e.substring(n.length)}}if(o=e.match(/^([a-zA-Z])/),o)return{match:o[1],rest:e.substring(1)};if(o=e.match(/^(-)?\d+(\.\d*)?/),o)return{match:o[0],rest:e.substring(o[0].length)};/^\\(left|right)/.test(e)||(o=e.match(/^(\\[a-zA-Z]+)/),o&&(r=e.substring(o[1].length),n=o[1]))}return{match:n,rest:r}}function tl(e,t){let n=Ys(null,e,t);return n?(n=n.replace("_{#?}",""),n=n.replace("^{#?}",""),n+=" "):n=e,n}function nl(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onSelectionDidChange)||e.suppressChangeNotifications||e.listeners.onSelectionDidChange(e)}function rl(e){var t;"function"!=typeof(null===(t=e.listeners)||void 0===t?void 0:t.onContentDidChange)||e.suppressChangeNotifications||e.listeners.onContentDidChange(e)}function ol(e){if(e.parent().array)return Bs(e.parent().array,e.relation())[e.anchorOffset()];const t=e.siblings();return t[Math.min(t.length-1,e.anchorOffset())]}function il(e,t,n=0){let r;if("string"==typeof t)r=Ds(t),r.extent=n;else if(si(t)){const o=Is(t),i=e.path;e.path=o,0===n&&"placeholder"===ol(e).type&&(o[o.length-1].offset=e.anchorOffset()-1,n=1),r={path:o,extent:null!=n?n:0},e.path=i}else r=t;const o=0!==Ps(e.path,r.path),i=r.extent!==e.extent;return(o||i)&&(o&&al(e),e.path=Is(r.path),e.siblings().length0&&"command"===t[n].type;)n-=1;let r=e.startOffset()+1;for(;r<=t.length-1&&"command"===t[r].type;)r+=1;return r>n?{start:n+1,end:r}:null}function dl(e){const t=kl(e)?ol(e):e.sibling(1);let n;if(t){if("command"===t.type)return"command";n=t.mode}let r=1,o=e.ancestor(r);for(;!n&&o;)o&&(n=o.mode),r+=1,o=e.ancestor(r);return n}function ul(e,t=1,n=!0){var r;const o=e.suppressChangeNotifications;e.suppressChangeNotifications=!0;const i=e.clone(),a=e.extent;ml(e,t),"placeholder"===ol(e).type&&ml(e,t);const s=Ol(e,((e,t)=>"placeholder"===e.type||t.path.length>1&&1===t.siblings().length),t);if(0===s.length){if(il(e,i,a),n&&(null===(r=e.hooks)||void 0===r?void 0:r.tabOut)&&e.hooks.tabOut(e,t>0?"forward":"backward")&&document.activeElement){const e=function(){function e(e){return!((n=e).disabled||"INPUT"===n.tagName&&"hidden"===n.type||function(e){if(e===document.activeElement||e.contains(document.activeElement))return!1;if("hidden"===getComputedStyle(e).visibility)return!0;const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;for(;e;){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n)||function(e){return"INPUT"===e.tagName&&"radio"===e.type&&!function(e){if(!e.name)return!0;const t=function(e,t){for(let n=0;nsummary')).filter(e).forEach(((e,n)=>{const i=t(e);0===i?r.push(e):o.push({documentOrder:n,tabIndex:i,node:e})})),o.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(r)}(document.body)}();let n=e.indexOf(document.activeElement)+t;n<0&&(n=e.length-1),n>=e.length&&(n=0),e[n].focus()}return e.suppressChangeNotifications=o,!1}return il(e,s[0]),"placeholder"===ol(e).type&&_l(e,-1),e.announce("move",i),nl(e),e.suppressChangeNotifications=o,!0}function pl(e,t=0,n=0,r=""){const o=e.path[e.path.length-1].relation;r||(r=o);const i=e.parent();if(!i&&"body"!==r)return!1;const a=r.startsWith("cell");if(!a&&!i[r]||a&&!i.array)return!1;const s=r!==o;e.path[e.path.length-1].relation=r;const l=e.siblings().length;e.path[e.path.length-1].relation=o;const c=e.extent;"end"===n&&(n=l-t-1),_l(e,n);const d=e.extent!==c;_l(e,c),t<0&&(t=l+t),t=Math.max(0,Math.min(t,l-1));const u=e.path[e.path.length-1].offset;return(s||u!==t||d)&&(s&&al(e),e.path[e.path.length-1].relation=r,e.path[e.path.length-1].offset=t,_l(e,n),nl(e)),!0}function hl(e,t){var n;t=null!=t?t:{};const r={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(e.anchorOffset()===e.siblings().length-1){al(e);let o=r[e.relation()];const i=e.parent();for(;o&&!i[o];)o=r[o];if(o)return void pl(e,0,0,o);if(e.parent().array){const t=js(e.parent().array);let n=parseInt(e.relation().match(/cell([0-9]*)$/)[1])+1;for(;n=0;){if(Bs(e.parent().array,t)&&pl(e,-1,0,"cell"+t))return;t-=1}}return void(1===e.path.length?(e.suppressChangeNotifications||!(null===(n=e.hooks)||void 0===n?void 0:n.moveOut)||e.hooks.moveOut(e,"backward"))&&(e.path[0].offset=e.root.body.length-1):(e.path.pop(),pl(e,e.anchorOffset()-1)))}const o=ol(e);if(!o.captureSelection){let t;if(o.array){t="";const n=js(o.array);let r=n-1;for(;!t&&r0)for(Ml(e)&&r--;r>0;)hl(e),r--;else if(r<0)for(Sl(e)&&r++;0!==r;)fl(e),r++}return nl(e),e.announce("move",r),!0}function gl(e,t){let n=e.path[e.path.length-1].offset,r=0;const o=e.clone();r=e.extent+t;const i=n+r;if(i<0&&0!==r){if(e.path.length>1)return e.path.pop(),_l(e,-1),nl(e),e.announce("move",o),!0;n=e.path[e.path.length-1].offset,r=e.extent}else if(i>=e.siblings().length){if(e.path.length>1)return e.path.pop(),e.path[e.path.length-1].offset-=1,_l(e,1),nl(e),e.announce("move",o),!0;kl(e)&&(n-=1),r-=1}return pl(e,n,r),e.announce("move",o),!0}function yl(e,t,n){var r;const o=null!==(r=(n=null!=n?n:{extend:!1}).extend)&&void 0!==r&&r;t=t<0?-1:1;const i=e.clone(),a=e.siblings(),s=e.focusOffset();let l=s+t;if(o&&(l=Math.min(Math.max(0,l),a.length-1)),l<0||l>=a.length)ml(e,t,n);else{if(a[l]&&"text"===a[l].mode){if(l=function(e,t,n){n=n<0?-1:1;const r=e.siblings();if(!r[t])return t;if("text"!==r[t].mode)return t;let o;if(da.test(r[t].body)){let e,i=t;do{e="text"===r[i].mode&&da.test(r[i].body),i+=n}while(r[i]&&e);o=r[i]?i-2*n:i-n}else if(/\s/.test(r[t].body)){let e=t;for(;r[e]&&"text"===r[e].mode&&/\s/.test(r[e].body);)e+=n;if(r[e]){let t=!0;do{t="text"===r[e].mode&&!/\s/.test(r[e].body),e+=n}while(r[e]&&t);o=r[e]?e-2*n:e-n}else o=e-n}else{let e=t;for(;r[e]&&"text"===r[e].mode&&!/\s/.test(r[e].body);)e+=n;o=r[e]?e:e-n;let i=!0;for(;r[e]&&i;)i="text"===r[e].mode&&/\s/.test(r[e].body),i&&(o=e),e+=n;o=r[e]?e-2*n:e-n}return o-(n>0?0:1)}(e,l,t),l<0&&!o)return void pl(e,0);if(l>a.length)return pl(e,a.length-1),void ml(e,t,n)}else{const e=a[l]?a[l].type:"";if("mopen"===e&&t>0||"mclose"===e&&t<0){let n="mopen"===e?1:-1;for(l+=t>0?1:-1;l>=0&&l0&&(l-=1)}else{for(;a[l]&&"math"===a[l].mode&&a[l].type===e;)l+=t;l-=t>0?1:0}}if(o){const t=e.anchorOffset();pl(e,t,l-t)}else pl(e,l);e.announce("move",i)}}function vl(e,t=1,n){var r;n=null!=n?n:{extend:!1},t=t<0?-1:1;const o=e.clone(),i=[{relation:"body",offset:e.path[0].offset}];let a;return null!==(r=!n.extend)&&void 0!==r&&r?(i[0].offset=t<0?0:e.root.body.length-1,a=0):t<0?i[0].offset>0&&(a=-i[0].offset):i[0].offset=r)return pl(e,e.endOffset()-1,1),!0;pl(e,n,r-n)}else if("mord"===e.sibling(0).type&&/[0-9,.]/.test(e.sibling(0).body)){let n=e.startOffset(),r=e.endOffset();for(;ll(t[n]);)n-=1;for(;ll(t[r]);)r+=1;r-=1,pl(e,n,r-n)}else pl(e,0,"end");return!0}function wl(e){return e.path=[{relation:"body",offset:0}],pl(e,0,"end")}function kl(e){return 0===e.extent}function _l(e,t){e.extent=t}function Ml(e){return 0!==e.extent&&(pl(e,e.endOffset()),!0)}function Sl(e){return 0!==e.extent&&(pl(e,e.startOffset()),!0)}function El(e){if(e.path.length>1){const t=e.clone();return e.path.pop(),_l(e,0),e.announce("move",t),!0}return e.announce("plonk"),!1}function zl(e,t,n,r={extendToWordBoundary:!1}){const o=Ps(t,n);if(0===o)return r.extendToWordBoundary?zl(e,t=Ll(e,t,-1),n=Ll(e,n,1)):il(e,Is(t),0);if(1===o){const o=n[n.length-1].offset-t[t.length-1].offset;return r.extendToWordBoundary?zl(e,t=Ll(e,t,o<0?1:-1),n=Ll(e,n,o<0?-1:1)):il(e,Is(t),o)}let i=function(e,t){const n=[],r=Math.min(e.length-1,t.length-1);let o=0;for(;o<=r&&e[o].relation===t[o].relation&&e[o].offset===t[o].offset;)n.push(e[o]),o+=1;return n}(t,n);const a=i.length;if(t.length===a||n.length===a||t[a].relation!==n[a].relation)return il(e,i,-1);i.push(t[a]),i=Is(i);let s=n[a].offset-t[a].offset+1;return s<=0?n.length>a+1?(i[a].relation=n[a].relation,i[a].offset=n[a].offset,i[i.length-1].offset-=1,s=2-s):(i[a].relation=n[a].relation,i[a].offset=n[a].offset,s=1-s):n.length<=t.length?i[i.length-1].offset-=1:n.length>t.length&&(i[a].offset-=1),il(e,i,s)}function Cl(e,t,n){var r;(n=null!=n?n:{}).recursive=null!==(r=n.recursive)&&void 0!==r&&r;const o=e.siblings(),i=e.startOffset()+1,a=e.endOffset()+1;if(n.recursive)for(let e=i;e=0?Ml(o):(Sl(o),ml(o,"forward"));const i=ol(o);do{t(ol(o),o)&&r.push(o.toString()),n>=0?hl(o,{iterateAll:!0}):fl(o,{iterateAll:!0})}while(i!==ol(o));return r}const Tl="apple"===Il()?{id:"apple.en-intl",displayName:"English (international)",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","ı"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","Î"],KeyE:["e","E","´","´"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","˝"],KeyH:["h","H","˙","Ó"],KeyI:["i","I","ˆ","ˆ"],KeyJ:["j","J","∆","Ô"],KeyK:["k","K","˚",""],KeyL:["l","L","¬","Ò"],KeyM:["m","M","µ","Â"],KeyN:["n","N","˜","˜"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®","‰"],KeyS:["s","S","ß","Í"],KeyT:["t","T","†","ˇ"],KeyU:["u","U","¨","¨"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","˛"],KeyY:["y","Y","¥","Á"],KeyZ:["z","Z","Ω","¸"],Digit1:["1","!","¡","⁄"],Digit2:["2","@","™","€"],Digit3:["3","#","£","‹"],Digit4:["4","$","¢","›"],Digit5:["5","%","∞","fi"],Digit6:["6","ˆ","§","fl"],Digit7:["7","&","¶","‡"],Digit8:["8","*","•","°"],Digit9:["9","(","ª","·"],Digit0:["0",")","º","‚"],Space:[" "," "," "," "],Minus:["-","_","–","—"],Equal:["=","+","≠","±"],BracketLeft:["[","{","“","”"],BracketRight:["]","}","‘","’"],Backslash:["\\","|","«","»"],Semicolon:[";",":","…","Ú"],Quote:["'",'"',"æ","Æ"],Backquote:["`","˜","`","`"],Comma:[",","<","≤","¯"],Period:[".",">","≥","˘"],Slash:["/","?","÷","¿"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["§","±","§","±"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}}:"windows"===Il()?{id:"windows.en-intl",displayName:"English (international)",platform:"windows",locale:"en",score:0,mapping:{KeyA:["a","A","á","Á"],KeyB:["b","B","",""],KeyC:["c","C","©","¢"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","é","É"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","í","Í"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","ø","Ø"],KeyM:["m","M","µ",""],KeyN:["n","N","ñ","Ñ"],KeyO:["o","O","ó","Ó"],KeyP:["p","P","ö","Ö"],KeyQ:["q","Q","ä","Ä"],KeyR:["r","R","®",""],KeyS:["s","S","ß","§"],KeyT:["t","T","þ","Þ"],KeyU:["u","U","ú","Ú"],KeyV:["v","V","",""],KeyW:["w","W","å","Å"],KeyX:["x","X","",""],KeyY:["y","Y","ü","Ü"],KeyZ:["z","Z","æ","Æ"],Digit1:["1","!","¡","¹"],Digit2:["2","@","²",""],Digit3:["3","#","³",""],Digit4:["4","$","¤","£"],Digit5:["5","%","€",""],Digit6:["6","^","¼",""],Digit7:["7","&","½",""],Digit8:["8","*","¾",""],Digit9:["9","(","‘",""],Digit0:["0",")","’",""],Space:[" "," ","",""],Minus:["-","_","¥",""],Equal:["=","+","×","÷"],BracketLeft:["[","{","«",""],BracketRight:["]","}","»",""],Backslash:["\\","|","¬","¦"],Semicolon:[";",":","¶","°"],Quote:["'",'"',"´","¨"],Backquote:["`","~","",""],Comma:[",","<","ç","Ç"],Period:[".",">","",""],Slash:["/","?","¿",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}}:{id:"linux.en",displayName:"English",platform:"linux",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Al={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Dl=[];let Pl;function Il(){let e="linux";return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?e="apple":/^(win)/i.test(navigator.platform)?e="windows":/(android)/i.test(navigator.userAgent)?e="linux":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?e="apple":/\bCrOS\b/i.test(navigator.userAgent)&&(e="linux")),e}function Nl(e){e.platform===Il()&&Dl.push(e)}function Rl(e){Pl=Dl.find((t=>e.startsWith(t.locale)))}function Bl(){return null!=Pl?Pl:Dl[0]}Nl(Tl),Nl({id:"apple.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","‡","Ω"],KeyB:["b","B","ß","∫"],KeyC:["c","C","©","¢"],KeyD:["d","D","∂","∆"],KeyE:["e","E","ê","Ê"],KeyF:["f","F","ƒ","·"],KeyG:["g","G","fi","fl"],KeyH:["h","H","Ì","Î"],KeyI:["i","I","î","ï"],KeyJ:["j","J","Ï","Í"],KeyK:["k","K","È","Ë"],KeyL:["l","L","¬","|"],KeyM:[",","?","∞","¿"],KeyN:["n","N","~","ı"],KeyO:["o","O","œ","Œ"],KeyP:["p","P","π","∏"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","®","‚"],KeyS:["s","S","Ò","∑"],KeyT:["t","T","†","™"],KeyU:["u","U","º","ª"],KeyV:["v","V","◊","√"],KeyW:["z","Z","Â","Å"],KeyX:["x","X","≈","⁄"],KeyY:["y","Y","Ú","Ÿ"],KeyZ:["w","W","‹","›"],Digit1:["&","1","","´"],Digit2:["é","2","ë","„"],Digit3:['"',"3","“","”"],Digit4:["'","4","‘","’"],Digit5:["(","5","{","["],Digit6:["§","6","¶","å"],Digit7:["è","7","«","»"],Digit8:["!","8","¡","Û"],Digit9:["ç","9","Ç","Á"],Digit0:["à","0","ø","Ø"],Space:[" "," "," "," "],Minus:[")","°","}","]"],Equal:["-","_","—","–"],BracketLeft:["^","¨","ô","Ô"],BracketRight:["$","*","€","¥"],Backslash:["`","£","@","#"],Semicolon:["m","M","µ","Ó"],Quote:["ù","%","Ù","‰"],Backquote:["<",">","≤","≥"],Comma:[";",".","…","•"],Period:[":","/","÷","\\"],Slash:["=","+","≠","±"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","•","Ÿ"],NumpadEqual:["=","=","=","="]}}),Nl({id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","ß",""],KeyC:["c","C","©"," "],KeyD:["d","D","∂","∆"],KeyE:["e","E","€","€"],KeyF:["f","F","ƒ","fi"],KeyG:["g","G","","fl"],KeyH:["h","H","™"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","¶","¯"],KeyK:["k","K","§","ˇ"],KeyL:["l","L"," ","˘"],KeyM:["m","M","µ","˚"],KeyN:["n","N"," ","˙"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","œ","Œ"],KeyR:["r","R","®"," "],KeyS:["s","S","∫"," "],KeyT:["t","T","†","‡"],KeyU:["u","U"," "," "],KeyV:["v","V","√","◊"],KeyW:["w","W","æ","Æ"],KeyX:["x","X","∑","›"],KeyY:["y","Y","¥"," "],KeyZ:["z","Z","Ω","‹"],Digit1:["1","!","|","ı"],Digit2:["2",'"',"@","˝"],Digit3:["3","·","#","•"],Digit4:["4","$","¢","£"],Digit5:["5","%","∞","‰"],Digit6:["6","&","¬"," "],Digit7:["7","/","÷","⁄"],Digit8:["8","(","“","‘"],Digit9:["9",")","”","’"],Digit0:["0","=","≠","≈"],Space:[" "," "," "," "],Minus:["'","?","´","¸"],Equal:["¡","¿","‚","˛"],BracketLeft:["`","^","[","ˆ"],BracketRight:["+","*","]","±"],Backslash:["ç","Ç","}","»"],Semicolon:["ñ","Ñ","~","˜"],Quote:["´","¨","{","«"],Backquote:["<",">","≤","≥"],Comma:[",",";","„",""],Period:[".",":","…","…"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["º","ª","\\","°"]}}),Nl({id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","·","#",""],Digit4:["4","$","~",""],Digit5:["5","%","€",""],Digit6:["6","&","¬",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["¡","¿","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["ç","Ç","}",""],Semicolon:["ñ","Ñ","",""],Quote:["´","¨","{",""],Backquote:["º","ª","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),Nl({id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",score:0,mapping:{KeyA:["a","A","æ","Æ"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:["m","M","µ","º"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["q","Q","@","Ω"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["w","W","ł","Ł"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["z","Z","«","<"],Digit1:["1","!","|","¡"],Digit2:["2",'"',"@","⅛"],Digit3:["3","·","#","£"],Digit4:["4","$","~","$"],Digit5:["5","%","½","⅜"],Digit6:["6","&","¬","⅝"],Digit7:["7","/","{","⅞"],Digit8:["8","(","[","™"],Digit9:["9",")","]","±"],Digit0:["0","=","}","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:["'","?","\\","¿"],Equal:["¡","¿","̃","~"],BracketLeft:["̀","̂","[","̊"],BracketRight:["+","*","]","̄"],Backslash:["ç","Ç","}","̆"],Semicolon:["ñ","Ñ","~","̋"],Quote:["́","̈","{","{"],Backquote:["º","ª","\\","\\"],Comma:[",",";","─","×"],Period:[".",":","·","÷"],Slash:["-","_","̣","̇"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}}),Nl({id:"linux.french",locale:"fr",displayName:"French",platform:"apple",score:0,mapping:{KeyA:["q","Q","@","Ω"],KeyB:["b","B","”","’"],KeyC:["c","C","¢","©"],KeyD:["d","D","ð","Ð"],KeyE:["e","E","€","¢"],KeyF:["f","F","đ","ª"],KeyG:["g","G","ŋ","Ŋ"],KeyH:["h","H","ħ","Ħ"],KeyI:["i","I","→","ı"],KeyJ:["j","J","̉","̛"],KeyK:["k","K","ĸ","&"],KeyL:["l","L","ł","Ł"],KeyM:[",","?","́","̋"],KeyN:["n","N","n","N"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","þ","Þ"],KeyQ:["a","A","æ","Æ"],KeyR:["r","R","¶","®"],KeyS:["s","S","ß","§"],KeyT:["t","T","ŧ","Ŧ"],KeyU:["u","U","↓","↑"],KeyV:["v","V","“","‘"],KeyW:["z","Z","«","<"],KeyX:["x","X","»",">"],KeyY:["y","Y","←","¥"],KeyZ:["w","W","ł","Ł"],Digit1:["&","1","¹","¡"],Digit2:["é","2","~","⅛"],Digit3:['"',"3","#","£"],Digit4:["'","4","{","$"],Digit5:["(","5","[","⅜"],Digit6:["-","6","|","⅝"],Digit7:["è","7","`","⅞"],Digit8:["_","8","\\","™"],Digit9:["ç","9","^","±"],Digit0:["à","0","@","°"],Enter:["\r","\r","\r","\r"],Escape:["","","",""],Backspace:["\b","\b","\b","\b"],Tab:["\t","","\t",""],Space:[" "," "," "," "],Minus:[")","°","]","¿"],Equal:["=","+","}","̨"],BracketLeft:["̂","̈","̈","̊"],BracketRight:["$","£","¤","̄"],Backslash:["*","µ","̀","̆"],Semicolon:["m","M","µ","º"],Quote:["ù","%","̂","̌"],Backquote:["²","~","¬","¬"],Comma:[";",".","─","×"],Period:[":","/","·","÷"],Slash:["!","§","̣","̇"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","¦"]}}),Nl({id:"windows.french",locale:"fr",displayName:"French",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["é","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["è","7","`",""],Digit8:["_","8","\\",""],Digit9:["ç","9","^",""],Digit0:["à","0","@",""],Space:[" "," ","",""],Minus:[")","°","]",""],Equal:["=","+","}",""],BracketLeft:["^","¨","",""],BracketRight:["$","£","¤",""],Backslash:["*","µ","",""],Semicolon:["m","M","",""],Quote:["ù","%","",""],Backquote:["²","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","§","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}}),Nl({id:"windows.german",locale:"de",displayName:"German",platform:"windows",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","€",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","µ",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"²",""],Digit3:["3","§","³",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["ß","?","\\","ẞ"],Equal:["´","`","",""],BracketLeft:["ü","Ü","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["ö","Ö","",""],Quote:["ä","Ä","",""],Backquote:["^","°","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}}),Nl({id:"apple.german",locale:"de",displayName:"German",platform:"apple",score:0,mapping:{KeyA:["a","A","å","Å"],KeyB:["b","B","∫","‹"],KeyC:["c","C","ç","Ç"],KeyD:["d","D","∂","™"],KeyE:["e","E","€","‰"],KeyF:["f","F","ƒ","Ï"],KeyG:["g","G","©","Ì"],KeyH:["h","H","ª","Ó"],KeyI:["i","I","⁄","Û"],KeyJ:["j","J","º","ı"],KeyK:["k","K","∆","ˆ"],KeyL:["l","L","@","fl"],KeyM:["m","M","µ","˘"],KeyN:["n","N","~","›"],KeyO:["o","O","ø","Ø"],KeyP:["p","P","π","∏"],KeyQ:["q","Q","«","»"],KeyR:["r","R","®","¸"],KeyS:["s","S","‚","Í"],KeyT:["t","T","†","˝"],KeyU:["u","U","¨","Á"],KeyV:["v","V","√","◊"],KeyW:["w","W","∑","„"],KeyX:["x","X","≈","Ù"],KeyY:["z","Z","Ω","ˇ"],KeyZ:["y","Y","¥","‡"],Digit1:["1","!","¡","¬"],Digit2:["2",'"',"“","”"],Digit3:["3","§","¶","#"],Digit4:["4","$","¢","£"],Digit5:["5","%","[","fi"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","˜"],Digit9:["9",")","}","·"],Digit0:["0","=","≠","¯"],Space:[" "," "," "," "],Minus:["ß","?","¿","˙"],Equal:["´","`","'","˚"],BracketLeft:["ü","Ü","•","°"],BracketRight:["+","*","±",""],Backslash:["#","'","‘","’"],Semicolon:["ö","Ö","œ","Œ"],Quote:["ä","Ä","æ","Æ"],Backquote:["<",">","≤","≥"],Comma:[",",";","∞","˛"],Period:[".",":","…","÷"],Slash:["-","_","–","—"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","°","„","“"],NumpadEqual:["=","=","=","="]}});const jl=[{key:"ctrl+alt+e",command:["insert","\\text{cmd+alt+e}"]},{key:"cmd+alt+a",command:["insert","\\text{cmd+alt+a}"]},{key:"ctrl+alt+a",command:["insert","\\text{ctrl+alt+a}"]},{key:"meta+alt+2",command:["insert","\\text{meta+alt+2}"]},{key:"ctrl+alt+shift+a",command:["insert","\\text{ctrl+alt+shift+a}"]},{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendToPreviousChar"},{key:"shift+[ArrowRight]",command:"extendToNextChar"},{key:"shift+[ArrowUp]",command:"extendUp"},{key:"shift+[ArrowDown]",command:"extendDown"},{key:"[Backspace]",command:"deletePreviousChar"},{key:"alt+[Delete]",command:"deletePreviousChar"},{key:"[Delete]",command:"deleteNextChar"},{key:"alt+[Backspace]",command:"deleteNextChar"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"alt+shift+[ArrowLeft]",command:"extendToPreviousWord"},{key:"alt+shift+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"ctrl+shift+[ArrowLeft]",command:"extendToGroupStart"},{key:"ctrl+shift+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Space]",ifMode:"math",command:"moveAfterParent"},{key:"shift+[Space]",ifMode:"math",command:"moveBeforeParent"},{key:"[Home]",command:"moveToMathFieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathFieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"cmd+shift+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathFieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathFieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"cmd+shift+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",ifMode:"math",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"math",command:"moveToPreviousPlaceholder"},{key:"[Tab]",ifMode:"text",command:"moveToNextPlaceholder"},{key:"shift+[Tab]",ifMode:"text",command:"moveToPreviousPlaceholder"},{key:"[Escape]",ifMode:"math",command:["switchMode","command"]},{key:"\\",ifMode:"math",command:["switchMode","command"]},{key:"alt+[Equal]",ifMode:"math",command:["applyStyle",{mode:"text"}]},{key:"alt+[Equal]",ifMode:"text",command:["applyStyle",{mode:"math"}]},{key:"[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[Tab]",ifMode:"command",command:["complete",{acceptSuggestion:!0}]},{key:"[Return]",ifMode:"command",command:"complete"},{key:"[Enter]",ifMode:"command",command:"complete"},{key:"shift+[Escape]",ifMode:"command",command:["complete",{discard:!0}]},{key:"[ArrowDown]",ifMode:"command",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"command",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deletePreviousChar"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"[Undo]",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+y",command:"redo"},{key:"ctrl+shift+z",ifPlatform:"!macos",command:"redo"},{key:"cmd+shift+z",command:"redo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathFieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathFieldEnd"},{key:"ctrl+shift+b",ifPlatform:"macos",command:"extendToPreviousChar"},{key:"ctrl+shift+f",ifPlatform:"macos",command:"extendToNextChar"},{key:"ctrl+shift+p",ifPlatform:"macos",command:"extendUp"},{key:"ctrl+shift+n",ifPlatform:"macos",command:"extendDown"},{key:"ctrl+shift+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"ctrl+shift+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"ctrl+alt+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"ctrl+alt+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"ctrl+shift+alt+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"ctrl+shift+alt+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deletePreviousChar"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteNextChar"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"shift+[Quote]",ifMode:"math",command:["switchMode","text","","“"]},{key:"shift+[Quote]",ifMode:"text",command:["switchMode","math","”",""]},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Minus]",ifMode:"math",command:"moveToSubscript"},{key:"alt+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrack #0 \\right\\rbrack$$"]},{key:"alt+shift+[BracketLeft]",ifMode:"math",command:["insert","$$\\left\\lbrace #0 \\right\\rbrace$$"]},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+;",ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifMode:"math",command:"addRowAfter"},{key:"ctrl+shift+;",ifMode:"math",command:"addRowBefore"},{key:"cmd+shift+;",ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"cmd+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"ctrl+shift+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"cmd+shift+[Comma]",ifMode:"math",command:"addColumnAfter"},{key:"alt+p",ifMode:"math",command:["insert","$$\\pi$$"]},{key:"alt+v",ifMode:"math",command:["insert","$$\\sqrt{#0}$$"]},{key:"alt+w",ifMode:"math",command:["insert","$$\\sum_{i=#?}^{#?}$$"]},{key:"alt+u",ifMode:"math",command:["insert","$$\\cup$$"]},{key:"alt+n",ifMode:"math",command:["insert","$$\\cap$$"]},{key:"alt+o",ifMode:"math",command:["insert","$$\\emptyset$$"]},{key:"alt+d",ifMode:"math",command:["insert","$$\\differentialD$$"]},{key:"alt+shift+o",ifMode:"math",command:["insert","$$\\varnothing$$"]},{key:"alt+shift+d",ifMode:"math",command:["insert","$$\\partial$$"]},{key:"alt+shift+p",ifMode:"math",command:["insert","$$\\prod_{i=#?}^{#?}$$"]},{key:"alt+shift+u",ifMode:"math",command:["insert","$$\\bigcup$$"]},{key:"alt+shift+n",ifMode:"math",command:["insert","$$\\bigcap$$"]},{key:"alt+shift+a",ifMode:"math",command:["insert","$$\\forall$$"]},{key:"alt+shift+e",ifMode:"math",command:["insert","$$\\exists$$"]},{key:"alt+[Digit5]",ifMode:"math",command:["insert","$\\infty$$"]},{key:"alt+[Digit6]",ifMode:"math",command:["insert","$$\\wedge$$"]},{key:"alt+shift+[Digit6]",ifMode:"math",command:["insert","$$\\vee$$"]},{key:"alt+[Digit9]",ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifMode:"math",command:["insert",")"]},{key:"alt+shift+[Backslash]",ifMode:"math",command:["insert","|"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","$$\\backslash$$"]},{key:"/",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+/",ifMode:"math",command:["insert","$$\\/$$"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","$$\\frac{#@}{#?}$$"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+[Backquote]",ifMode:"math",command:["insert","$$\\~$$"]},{key:"alt+shift+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleVirtualKeyboard"},{key:"ctrl+alt+[ArrowUp]",command:["speak","parent",{withHighlighting:!1}]},{key:"ctrl+alt+[ArrowDown]",command:["speak","all",{withHighlighting:!1}]}],$l={"\\theta":"alt+q","\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\prod":"alt+shift+p","\\sum":"alt+w","\\int":"alt+b","\\cup":"alt+u","\\cap":"alt+n","\\bigcup":"alt+shift+u","\\bigcap":"alt+shift+n","\\forall":"alt+shift+a","\\exists":"alt+shift+e","\\infty":"alt+[Digit5]","\\wedge":"alt+[Digit5]","\\vee":"alt+shift+[Digit6]","\\differentialD":"alt+d","\\partial":"alt+shift+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"alt+shift+o","\\~":"~"};function Kl(e){if((null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)){let t;if(/^(mac)/i.test(navigator.platform)?t="macos":/^(win)/i.test(navigator.platform)?t="windows":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos"),e.startsWith("!")&&!e.endsWith(t))return!0;if(e.endsWith(t))return!0}return!1}function ql(e){let t=e;return si(t)&&(t=t.length>0?t[0]+"("+t.slice(1).join("")+")":""),t}function Fl(e){var t;const n=Kl("macos")||Kl("ios"),r=e.split("+");let o="";for(const e of r)!n&&o&&(o+='+'),e.startsWith("Key")?o+=e.substr(3,1):e.startsWith("Digit")?o+=e.substr(5,1):o+=null!==(t={cmd:"⌘",meta:n?"⌘":"command",shift:n?"⇧":"shift",alt:n?"⌥":"alt",ctrl:n?"⌃":"control","\n":n?"⏎":"return","[return]":n?"⏎":"return","[enter]":n?"⌤":"enter","[tab]":n?"⇥":"tab","[escape]":"esc","[backspace]":n?"⌫":"backspace","[delete]":n?"⌦":"del","[pageup]":n?"⇞":"page up","[pagedown]":n?"⇟":"page down","[home]":n?"⤒":"home","[end]":n?"⤓":"end","[space]":"space","[equal]":"=","[minus]":"-","[comma]":",","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",bracketLeft:"[",bracketRight:"]",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"⇠",up:"⇡",right:"⇢",down:"⇣","[arrowleft]":"⇠","[arrowup]":"⇡","[arrowright]":"⇢","[arrowdown]":"⇣","[digit0]":"0","[digit1]":"1","[digit2]":"2","[digit3]":"3","[digit4]":"4","[digit5]":"5","[digit6]":"6","[digit7]":"7","[digit8]":"8","[digit9]":"9"}[e.toLowerCase()])&&void 0!==t?t:e.toUpperCase();return o}function Hl(e,t){const n=[],r=[];return e.forEach((e=>{try{const t=function(e){if(e.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(e.ifPlatform))throw new Error(`Unexpected platform "${e.ifPlatform}" for keybinding ${e.key}`);let t=e.key.split("+");const n=t.pop();let r=e.ifPlatform;if(t=t.map((e=>{const t=e.toLowerCase();if("cmd"===t){if(r&&"macos"!==r&&"ios"!==r)throw new Error('Unexpected "cmd" modifier with platform "'+r+'"');return r||(r=Kl("ios")?"ios":"macos"),"meta"}if("win"===t){if(r&&"windows"!==r)throw new Error('Unexpected "win" modifier with platform "'+r+'"');return r="windows","meta"}return t})),!r||Kl(r)){if(/^\[(.*)\]$/.test(n))t.push(n);else{const r=function(e){var t,n;const r=null!==(t=Bl())&&void 0!==t?t:Tl;for(const[t,n]of Object.entries(r.mapping)){if(n[0]===e)return"["+t+"]";if(n[1]===e)return"shift+["+t+"]";if(n[2]===e)return"alt+["+t+"]";if(n[3]===e)return"shift+alt+["+t+"]"}return null!==(n=Al[e])&&void 0!==n?n:""}(n);if(!r)throw new Error('Invalid keybinding key "'+e.key+'"');t=t.concat(r.split("+"))}return{...e,ifPlatform:r,key:t.join("+")}}}(e);t&&n.push(t)}catch(e){r.push(e.message)}})),r.length>0&&t(r),n}function Wl(e,t,n,r){const o=t.split(" ");for(const t of o){const o=t.match(/(.*):(.*)/);if(o){const t=null!=r?r:{};"active"===o[2]?t.passive=!1:t[o[2]]=!0,e.addEventListener(o[1],n,t)}else e.addEventListener(t,n,r)}}function Vl(e,t,n,r){const o=t.split(" ");for(const t of o){const o=t.match(/(.*):(.*)/);if(o){const t=null!=r?r:{};"active"===o[2]?t.passive=!1:t[o[2]]=!0,e.removeEventListener(o[1],n,t)}else e.removeEventListener(t,n,r)}}function Ul(e,t){let n=document.getElementById(e);return n?n.setAttribute("data-refcount",Number(parseInt(n.getAttribute("data-refcount"))+1).toString()):(n=document.createElement("div"),n.setAttribute("aria-hidden","true"),n.setAttribute("data-refcount","1"),n.className=t,n.id=e,document.body.appendChild(n)),n}function Zl(e){if(!e)return;const t=parseInt(e.getAttribute("data-refcount"));t<=1?e.remove():e.setAttribute("data-refcount",Number(t-1).toString())}function Gl(e){return e.element&&e.element.mathfield===e}function Xl(e){const t=function(e){var t,n;return null!==(n=null!==(t=e.querySelector(".ML__caret"))&&void 0!==t?t:e.querySelector(".ML__text-caret"))&&void 0!==n?n:e.querySelector(".ML__command-carett")}(e);if(t){const e=t.getBoundingClientRect();return{x:e.right,y:e.bottom,height:e.height}}return null}function Yl(e){const t=e.querySelectorAll(".ML__selected");if(t&&t.length>0){const n={top:1/0,bottom:-1/0,left:1/0,right:-1/0};t.forEach((e=>{const t=e.getBoundingClientRect();t.leftn.right&&(n.right=t.right),t.bottom>n.bottom&&(n.bottom=t.bottom),t.top{if("mousedown"!==n.type||1===n.buttons){n.stopPropagation(),"touchstart"!==n.type&&n.preventDefault(),t.classList.add("pressed"),r=Date.now(),"touchstart"===n.type&&(i=n.changedTouches[0].identifier);const a=t.getAttribute("data-"+e.options.namespace+"command-pressed");a&&e.executeCommand(JSON.parse(a));const l=t.getAttribute("data-"+e.options.namespace+"command-pressAndHoldStart");l&&(o=t,s&&clearTimeout(s),s=window.setTimeout((function(){t.classList.contains("pressed")&&e.executeCommand(JSON.parse(l))}),300))}})),Wl(t,"mouseleave touchcancel",(()=>{t.classList.remove("pressed")})),Wl(t,"touchmove:passive",(e=>{for(let t=0;t{1===e.buttons&&t.classList.add("pressed")})),Wl(t,"mouseup touchend click",(n=>{if(a){n.stopPropagation(),n.preventDefault();const e=a;return a=null,void e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0}))}if(t.classList.remove("pressed"),t.classList.add("active"),"click"===n.type&&0!==n.detail)return n.stopPropagation(),void n.preventDefault();window.setTimeout((function(){t.classList.remove("active")}),150);let i=t.getAttribute("data-"+e.options.namespace+"command-pressAndHoldEnd");const s=Date.now();(t!==o||sequal to","\\supseteq":"superset of or
equal to","\\supset":"superset of","\\subset":"subset of","\\partial":"partial derivative","\\bigcup":"union","\\bigcap":"intersection","\\approx":"approximately equal to","\\notin":"not an element of","\\in":["element of","included in"],"\\infty":"infinity","\\land":"logical and","\\sqrt":"square root","\\prod":"product","\\sum":"summation","\\amalg":["amalgamation","coproduct","free product","disjoint union"],"\\cup":"union with","\\cap":"intersection with","\\int":"integral","\\iint":"surface integral","\\oint":"curve integral","\\iiint":"volume integral","\\iff":"if and only if","\\ln":"natural logarithm","\\boldsymbol":"bold","\\setminus":"set subtraction","\\stackrel":"relation with symbol above","\\stackbin":"operator with symbol above","\\underset":"symbol with annotation below","\\overset":"symbol with annotation above","\\hslash":["h-bar","Planck constant"],"\\gtrsim":"greater than or
similar to","\\propto":"proportional to","\\equiv":"equivalent to","\\!":["negative thin space","(-3 mu)"],"\\ ":["space","(6 mu)"],"\\,":["thin space","(3 mu)"],"\\:":["medium space","(4 mu)"],"\\;":["thick space","(5 mu)"],"\\quad":["1 em space","(18 mu)"],"\\qquad":["2 em space","(36 mu)"],"\\enskip":["½ em space","(9 mu)"],"\\mp":"minus or plus","\\pm":"plus or minus","\\Im":"Imaginary part of","\\Re":"Real part of","\\gothicCapitalR":"Real part of","\\gothicCapitalI":"Imaginary part part of","\\differentialD":"differential d","\\aleph":["aleph","infinite cardinal",'Wikipedia '],"\\beth":["beth","beth number",'Wikipedia '],"\\gimel":["gimel","gimel function",'Wikipedia '],"\\O":"empty set","\\N":"set of
natural numbers","\\Z":"set of
integers","\\Q":"set of
rational numbers","\\C":"set of
complex numbers","\\R":"set of
real numbers","\\P":"set of
prime numbers","\\lesseqqgtr":"less than, equal to or
greater than","\\gnapprox":"greater than and
not approximately","\\lnapprox":"lesser than and
not approximately","\\j":"dotless j","\\i":"dotless i","\\cdot":"centered dot","\\lmoustache":"left moustache","\\rmoustache":"right moustache","\\nabla":["nabla","del","differential vector operator"],"\\square":["square","d’Alembert operator",'Wikipedia '],"\\blacksquare":["black square","end of proof","tombstone","Halmos symbol"],"\\Box":"end of proof","\\colon":["such that","ratio"],"\\coloneq":["is defined by","is assigned"],"\\Colon":["is defined by","as"],"\\_":["underbar","underscore"],"\\ll":"much less than","\\gg":"much greater than","\\doteq":"approximately equal to","\\Doteq":"approximately equal to","\\doteqdot":"approximately equal to","\\cong":["isomorphism of","(for algebras, modules...)"],"\\det":["determinant of","(of a matrix)"],"\\dotplus":"Cartesian product algebra","\\otimes":["tensor product","(of algebras)","Kronecker product","(of matrices)"],"\\oplus":["direct sum","(of modules)"],"\\lb":"base-2 logarithm","\\lg":"base-10 logarithm","\\wp":["Weierstrass P",'Wikipedia '],"\\wr":["wreath product",'Wikipedia '],"\\top":["tautology","Proposition P is universally true"],"\\bot":["contradiction","Proposition P is contradictory"],"\\mid":["probability","of event A given B"],"\\mho":["Siemens","electrical conductance in SI unit",'Wikipedia '],"\\Longrightarrow":"implies","\\Longleftrightarrow":"if, and only if,","\\prec":"precedes","\\preceq":"precedes or is equal to","\\succ":"succeedes","\\succeq":"succeedes or is equal to","\\perp":["is perpendicular to","is independent of"],"\\models":["entails","double-turnstyle, models","is a semantic consequence of",'Wikipedia '],"\\vdash":["satisfies","turnstyle, assertion sign","syntactic inference",'Wikipedia '],"\\implies":["implies","logical consequence"],"\\impliedby":["implied by","logical consequence"],"\\surd":["surd","root of","checkmark"],"\\ltimes":["semi direct product",'Wikipedia '],"\\rtimes":["semi direct product",'Wikipedia '],"\\leftthreetimes":["semi direct product",'Wikipedia '],"\\rightthreetimes":["semi direct product",'Wikipedia '],"\\divideontimes":["divide on times"],"\\curlywedge":"nor","\\curlyvee":"nand","\\simeq":"is group isomorphic with","\\vartriangleleft":["is a normal subgroup of","is an ideal ring of"],"\\circ":["circle","ring","function composition"],"\\rlap":["overlap right","\\rlap{x}o"],"\\llap":["overlap left","o\\llap{/}"],"\\colorbox":["color box","\\colorbox{#fbc0bd}{...}"],"\\ast":["asterisk","reflexive closure (as a superscript)"],"\\bullet":"bullet","\\lim":"limit"};function ec(e,t,n){if(!t||0===t.length)return void rc(e);const r=t,o=function(e,t){const n=_s(e,"math",null,t.options.macros);return Xi(Zi(ms({mathstyle:Li.displaystyle,macros:t.options.macros},n),"ML__base"),"ML__mathlive").toMarkup()}(t,e),i=function(e){let t=Ql[e]||"";return si(t)&&(t=t.join("
")),t}(r),a=function(e,t){let n=[];if("string"==typeof t){const e=$l[t];si(e)?n=e.slice():e&&n.push(e)}const r=ql(t),o=new RegExp("^"+r.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");return e.forEach((e=>{o.test(ql(e.command))&&n.push(e)})),n.map(Fl)}(e.keybindings,r).join("
");let s=n?'

':"";s+='',s+='
'+o+"
",i&&(s+='
'+i+"
"),a&&(s+='
'+a+"
"),s+="
",s+=n?'
':"",function(e,t){e.popover.innerHTML=e.options.createHTML(t);const n=Xl(e.field);n&&nc(e,n),e.popover.classList.add("is-visible")}(e,s);let l=e.popover.getElementsByClassName("ML__popover__content");l&&l.length>0&&Jl(e,l[0],{default:["complete",{acceptSuggestion:!0}]}),l=e.popover.getElementsByClassName("ML__popover__prev-shortcut"),l&&l.length>0&&Jl(e,l[0],"previousSuggestion"),l=e.popover.getElementsByClassName("ML__popover__next-shortcut"),l&&l.length>0&&Jl(e,l[0],"nextSuggestion")}function tc(e,t){if(e.element&&e.element.mathfield===e&&e.popover.classList.contains("is-visible"))if(null==t?void 0:t.deferred)window.requestAnimationFrame((()=>tc(e)));else if(ol(e.model)&&"command"===ol(e.model).type){const t=Xl(e.field);t&&nc(e,t)}else rc(e)}function nc(e,t){const n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerWidth-document.documentElement.clientWidth,i=window.innerHeight-document.documentElement.clientHeight,a=e.virtualKeyboardVisible?e.virtualKeyboard.element.offsetHeight:0;t.x+e.popover.offsetWidth/2>r-o?e.popover.style.left=r-e.popover.offsetWidth-o+"px":t.x-e.popover.offsetWidth/2<0?e.popover.style.left="0":e.popover.style.left=t.x-e.popover.offsetWidth/2+"px",t.y+e.popover.offsetHeight+5>n-i-a?(e.popover.classList.add("ML__popover--reverse-direction"),e.popover.style.top=t.y-t.height-e.popover.offsetHeight-5+"px"):(e.popover.classList.remove("ML__popover--reverse-direction"),e.popover.style.top=t.y+5+"px")}function rc(e){e.popover.classList.remove("is-visible")}function oc(e,t=!1){var n;let r="";const o=cl(e);if(o){const i=t?e.anchorOffset()+1:o.end,a=e.siblings();for(let e=o.start;e{"placeholder"===e.type&&r.push(e)}));_l(e,0),e.path[e.path.length-1].offset=n.start-1,0!==r.length&&ul(e,1,!1)||pl(e,n.start+t.length-1)}else e.siblings().splice(n.start,n.end-n.start),pl(e,n.start-1,0);rl(e)}}function sc(e){if(e)if(si(e))for(let t=e.length-1;t>=0;t--)"command"===e[t].type?e.splice(t,1):sc(e[t]);else if(sc(e.body),sc(e.superscript),sc(e.subscript),sc(e.underscript),sc(e.overscript),sc(e.numer),sc(e.denom),sc(e.index),e.array)for(let t=js(e.array);t>=0;t--)sc(Bs(e.array,t))}function lc(e){const t=e.suppressChangeNotifications;e.suppressChangeNotifications=!0,sc(e.root.body),e.suppressChangeNotifications=t,rl(e)}const cc={"\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"∥","\\mid":"∣","\\lbrace":"{","\\rbrace":"}","\\langle":"⟨","\\rangle":"⟩","\\lfloor":"⌊","\\rfloor":"⌋","\\lceil":"⌈","\\rceil":"⌉","\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};function dc(e){return e.replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function uc(e,t){return e&&t.generateID?' extid="'+e+'"':""}function pc(e,t,n){let r=!1;t=t||e.atoms.length;let o="",i="",a=-1,s=-1;const l=e.atoms[e.index];if(e.index0){if(r=!0,hc(e)&&(a=e.index,e.index+=1),fc(e)&&(s=e.index,e.index+=1),a>=0&&s>=0)o=""+i,o+=xc(e.atoms[s].subscript,0,0,n).mathML,o+=xc(e.atoms[a].superscript,0,0,n).mathML,o+="";else if(a>=0){if(o=""+i,hc(e)){const t=xc(e.atoms[a].superscript,0,0,n).mathML,r=xc(e.atoms[a+1].superscript,0,0,n).mathML;o+=""!==t&&""!==t||""!==r&&""!==r?""===t||""===t?"":t:""}else o+=xc(e.atoms[a].superscript,0,0,n).mathML;o+=""}else s>=0?(o=""+i,o+=xc(e.atoms[s].subscript,0,0,n).mathML,o+=""):o=i;"mi"!==e.lastType&&"mn"!==e.lastType&&"mtext"!==e.lastType&&"fence"!==e.lastType||/^(.*)<\/mo>$/.test(o)||(o=""+o),i.endsWith(">f")||i.endsWith(">g")?(o+="&x2061;",e.lastType="applyfunction"):e.lastType=/^(.*)<\/mo>$/.test(o)?"mo":"mi",e.mathML+=o}return r}function hc(e){return e.index"+e,o+=xc(i.subscript,0,0,n).mathML,o+=xc(i.superscript,0,0,n).mathML,o+=""):i.superscript?(o=""+e,o+=xc(i.superscript,0,0,n).mathML,o+=""):i.subscript&&(o=""+e,o+=xc(i.subscript,0,0,n).mathML,o+=""),o.length>0&&(r=!0,t.mathML+=o,t.lastType=""),r))}function gc(e,t,n){let r=!1;t=t||e.atoms.length;const o=e.index;let i="";for(;e.index0&&(r=!0,i=""+i+"",e.mathML+=i,e.lastType="mtext"),r}function yc(e,t,n){let r=!1;t=t||e.atoms.length;const o=e.index;let i="",a=function(e){let t=-1,n=e.index,r=!1,o=!1;for(;n=0&&a=0;)i+=e.atoms[e.index].body,e.index+=1;return i.length>0&&(r=!0,i=""+i+"",a<0&&hc(e)&&(a=e.index,e.index+=1),a>=0&&(i=""+i,i+=xc(e.atoms[a].superscript,0,0,n).mathML,i+=""),e.mathML+=i,e.lastType="mn"),r}function vc(e,t,n){let r=!1;t=t||e.atoms.length;let o="",i="";if(e.index",o+=wc(e.atoms[l],n),o+=xc(e.atoms,l+1,c,n).mathML,o+=wc(e.atoms[c],n),o+="","mi"!==e.lastType&&"mn"!==e.lastType&&"mfrac"!==e.lastType&&"fence"!==e.lastType||(o=""+o),e.index=c+1,mc(o,e,n)&&(r=!0,e.lastType="",o=""),i="fence")}return o.length>0&&(r=!0,e.mathML+=o,e.lastType=i),r}function bc(e,t,n){let r=!1;t=t||e.atoms.length;let o="",i="";const a=e.atoms[e.index];if(e.index":"")+e,o+=xc(a.subscript,0,0,n).mathML,o+=xc(a.superscript,0,0,n).mathML,o+="nolimits"!==a.limits?"":""):a.superscript?(o+=("nolimits"!==a.limits?"":"")+e,o+=xc(a.superscript,0,0,n).mathML,o+="nolimits"!==a.limits?"":""):(o+=("nolimits"!==a.limits?"":"")+e,o+=xc(a.subscript,0,0,n).mathML,o+="nolimits"!==a.limits?"":""),i="mo"}else{const t=e.atoms[e.index],a="\\operatorname"===t.symbol,s=a?'"+kc(t.body)+"":wc(t,n);o+=s,e.index+=1,mc(o,e,n)&&(r=!0,e.lastType="",o=""),e.index-=1,a||/^(.*)<\/mo>$/.test(s)?i=a?"mi":"mo":(o+="",i="applyfunction")}"mi"!==e.lastType&&"mn"!==e.lastType||/^(.*)<\/mo>$/.test(o)||(o=""+o),e.index+=1}return o.length>0&&(r=!0,e.mathML+=o,e.lastType=i),r}function xc(e,t,n,r){const o={atoms:e,index:null!=t?t:0,mathML:"",lastType:""};if("number"==typeof e||"boolean"==typeof e)o.mathML=e.toString();else if("string"==typeof e)o.mathML=e;else if(e instanceof gs)o.mathML=_c(e,r);else if(Array.isArray(e)){let t=0;for(n=n||(e?e.length:0);o.index0&&"genfrac"===o.atoms[o.index].type&&(e=""+e),"genfrac"===o.atoms[o.index].type?o.lastType="mfrac":o.lastType="",e.length>0&&(o.mathML+=e,t+=1),o.index+=1}t>1&&(o.mathML=""+o.mathML+"")}return o}function wc(e,t){let n="";const r=kc(e.body);return r&&(n=""+r+""),n}function kc(e){if(!e)return"";if("string"==typeof e)return dc(e);if(!Array.isArray(e)&&"string"==typeof e.body)return dc(e.body);let t="";for(const n of e)"string"==typeof n.body&&(t+=n.body);return dc(t)}function _c(e,t){var n,r,o,i,a,s,l,c,d,u,p,h;const f={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋"},m={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"ℏ","\\cdotp":"⋅","\\ldots":"…","\\cdots":"⋯","\\ddots":"⋱","\\vdots":"⋮","\\ldotp":"."},g={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let y,v,b,x,w,k,_="",M="",S={cal:"script",frak:"fraktur",bb:"double-struck",scr:"script",cmtt:"monospace",cmss:"sans-serif"}[e.fontFamily||e.font]||"";S&&(S=' mathvariant="'+S+'"');const E=e.symbol;if("text"===e.mode)_=""+e.body+"";else switch(e.type){case"first":case"line":case"overlap":case"mathstyle":case"msupsub":case"phantom":case"composition":break;case"group":case"root":_=xc(e.body,0,0,t).mathML;break;case"array":if((e.leftDelim&&"."!==e.leftDelim||e.rightDelim&&"."!==e.rightDelim)&&(_+="",e.leftDelim&&"."!==e.leftDelim&&(_+=""+(cc[e.leftDelim]||e.leftDelim)+"")),_+="",y=0;y"+xc(e.array[v][y],0,0,t).mathML+"";_+=""}_+="",(e.leftDelim&&"."!==e.leftDelim||e.rightDelim&&"."!==e.rightDelim)&&(e.rightDelim&&"."!==e.rightDelim&&(_+=""+(cc[e.leftDelim]||e.rightDelim)+""),_+="");break;case"genfrac":(e.leftDelim||e.rightDelim)&&(_+=""),e.leftDelim&&"."!==e.leftDelim&&(_+=""+(cc[e.leftDelim]||e.leftDelim)+""),e.hasBarLine?(_+="",_+=xc(e.numer,0,0,t).mathML||" ",_+=xc(e.denom,0,0,t).mathML||" ",_+=""):(_+="",_+=""+xc(e.numer,0,0,t).mathML+"",_+=""+xc(e.denom,0,0,t).mathML+"",_+=""),e.rightDelim&&"."!==e.rightDelim&&(_+=""+(cc[e.rightDelim]||e.rightDelim)+""),(e.leftDelim||e.rightDelim)&&(_+="");break;case"surd":e.index?(_+="",_+=xc(e.body,0,0,t).mathML,_+=xc(e.index,0,0,t).mathML,_+=""):(_+="",_+=xc(e.body,0,0,t).mathML,_+="");break;case"leftright":_="",e.leftDelim&&"."!==e.leftDelim&&(_+=""+(cc[e.leftDelim]||e.leftDelim)+""),e.body&&(_+=xc(e.body,0,0,t).mathML),e.rightDelim&&"."!==e.rightDelim&&(_+=""+(cc[e.rightDelim]||e.rightDelim)+""),_+="";break;case"sizeddelim":case"delim":_+='"+(cc[e.delim]||e.delim)+"";break;case"accent":_+='",_+=xc(e.body,0,0,t).mathML,_+=""+(cc[E]||e.accent)+"",_+="";break;case"overunder":w=e.overscript,x=e.underscript,(e.svgAbove||w)&&(e.svgBelow||x)?k=e.body:w&&w.length>0?(k=e.body,(null===(r=null===(n=e.body)||void 0===n?void 0:n[0])||void 0===r?void 0:r.underscript)?(x=e.body[0].underscript,k=e.body[0].body):"first"===(null===(i=null===(o=e.body)||void 0===o?void 0:o[0])||void 0===i?void 0:i.type)&&(null===(s=null===(a=e.body)||void 0===a?void 0:a[1])||void 0===s?void 0:s.underscript)&&(x=e.body[1].underscript,k=e.body[1].body)):x&&x.length>0&&(k=e.body,(null===(c=null===(l=e.body)||void 0===l?void 0:l[0])||void 0===c?void 0:c.overscript)?(w=e.body[0].overscript,k=e.body[0].body):"first"===(null===(u=null===(d=e.body)||void 0===d?void 0:d[0])||void 0===u?void 0:u.type)&&(null===(h=null===(p=e.body)||void 0===p?void 0:p[1])||void 0===h?void 0:h.overscript)&&(w=e.body[1].overscript,k=e.body[1].body)),(e.svgAbove||w)&&(e.svgBelow||x)?(_+=``,_+=f[e.svgBody]||xc(k,0,0,t).mathML,_+=f[e.svgBelow]||xc(x,0,0,t).mathML,_+=f[e.svgAbove]||xc(w,0,0,t).mathML,_+=""):e.svgAbove||w?(_+=``+(f[e.svgBody]||xc(k,0,0,t).mathML),_+=f[e.svgAbove]||xc(w,0,0,t).mathML,_+=""):(e.svgBelow||x)&&(_+=``+(f[e.svgBody]||xc(k,0,0,t).mathML),_+=f[e.svgBelow]||xc(x,0,0,t).mathML,_+="");break;case"placeholder":case"mord":{_=m[E]||E||("string"==typeof e.body?e.body:"");const n=E?E.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null;n?_="&#x"+n[1]+";":_.length>0&&"\\"===_.charAt(0)&&(_="string"==typeof e.body&&e.body.charCodeAt(0)>255?"&#x"+("000000"+e.body.charCodeAt(0).toString(16)).substr(-4)+";":"string"==typeof e.body?e.body.charAt(0):e.body);const r=/\d/.test(_)?"mn":"mi";_="<"+r+S+uc(e.id,t)+">"+dc(_)+"";break}case"mbin":case"mrel":case"textord":case"minner":_=E&&m[E]?""+m[E]+"":E&&cc[E]?""+cc[E]+"":wc(e,t);break;case"mpunct":_='"+(cc[E]||E)+"";break;case"mop":"​"!==e.body&&(_="",_+="\\operatorname"===E?e.body:E||e.body,_+="");break;case"box":_='"+xc(e.body,0,0,t).mathML+"";break;case"spacing":_+='';break;case"enclose":_=''+xc(e.body,0,0,t).mathML+"";break;case"space":_+=" ";break;default:console.log("In conversion to MathML, unknown type : "+e.type)}return _}function Mc(e,t){return xc(e,0,0,t).mathML}function Sc(e){let t=0;for(let n=0;n{Gl(e)&&e.dirty&&zc(e)})))}function zc(e,t){t=null!=t?t:{},e.dirty=!1,window.mathlive||(window.mathlive={}),ol(e.model)||(console.warn("Invalid selection, resetting it. "+As(e.model.path)),e.model.path=[{relation:"body",offset:0}]),e.model.root.forEach((e=>{e.caret="",e.isSelected=!1,e.containsCaret=!1}));const n=e.hasFocus();if(kl(e.model)?ol(e.model).caret=n&&!e.options.readOnly?e.mode:"":Cl(e.model,(e=>{e.isSelected=!0})),n&&!e.options.readOnly){let t=e.model.ancestor(1),n=1,r=!1;for(;t&&!r;)"surd"!==t.type&&"leftright"!==t.type||(t.containsCaret=!0,r=!0),n+=1,t=e.model.ancestor(n)}const r=Zi(ms({mathstyle:Li.displaystyle,letterShapeStyle:e.options.letterShapeStyle,atomIdsSettings:{seed:Sc(e.model.root.toLatex(!1)),groupNumbers:t.forHighlighting},smartFence:e.options.smartFence,macros:e.options.macros},e.model.root),"ML__base");r.attributes={translate:"no","aria-hidden":"true"};const o=Xi(r,"ML__mathlive");e.field.innerHTML=e.options.createHTML(o.toMarkup(0,e.options.horizontalSpacingScale)),e.field.classList.toggle("ML__focused",n&&!e.options.readOnly),e.accessibleNode.innerHTML=e.options.createHTML(''+Mc(e.model.root,e.options)+"");const i=Yl(e.field);if(null!==i){const t=document.createElement("div");t.classList.add("ML__selection"),t.style.position="absolute",t.style.left=Number(i.left).toString()+"px",t.style.top=Number(i.top).toString()+"px",t.style.width=Number(Math.ceil(i.right-i.left)).toString()+"px",t.style.height=Number(Math.ceil(i.bottom-i.top-1)).toString()+"px",e.field.insertBefore(t,e.field.childNodes[0])}}const Cc={};function Lc(e,t){t=null!=t?t:{target:"mathfield",canUndo:!1},Object.keys(e).forEach((n=>{console.assert(!Cc[n],"Selector already defined: ",n),Cc[n]={...t,fn:e[n]}}))}function Oc(e,t=",",n){if(!e)return[];let r,o=[];for(let i of e)i&&i.length>0&&"first"===i[0].type&&(i=i.slice(1)),i&&i.length>0&&(r?o.push(r):r=new gs("math","mpunct",t,n),o=o.concat(i));return o}function Tc(e,t){const n=e.parent();if(n&&"array"===n.type&&si(n.array)){const r=e.relation();if(n.array){const o=Rs(n.array,r);"after row"===t||"before row"===t?(o.col=0,o.row=o.row+("after row"===t?1:0),n.array.splice(o.row,0,[[]])):(o.col+="after column"===t?1:0,n.array[o.row].splice(o.col,0,[]));const i=Ns(n.array,o);e.path.pop(),e.path.push({relation:"cell"+i.toString(),offset:0}),e.insertFirstAtom()}}}function Ac(e){var t;const n=e.parent();if("leftright"===n.type){n.type="array";const r=null!==(t={"(":"pmatrix","\\lbrack":"bmatrix","\\lbrace":"cases"}[n.leftDelim])&&void 0!==t?t:"matrix",o=wa(r),i=[[n.body]];Object.assign(n,o.parser(r,[],i)),n.mode=dl(e),n.environmentName=r,n.array=i,n.rowGaps=[0],delete n.body,e.path[e.path.length-1].relation="cell0"}}function Dc(e){return Ac(e),Tc(e,"after row"),rl(e),!0}function Pc(e){return Ac(e),Tc(e,"after column"),rl(e),!0}function Ic(e,t=0){const n=e.suppressChangeNotifications;if(e.suppressChangeNotifications=!0,t=t<0?-1:t>0?1:t,Ls(e),e.parent().array&&t<0&&0===e.startOffset()){const t=e.parent().array;if(function(e){const t={col:0,row:0};for(;t.row0){let e=t.length;"first"===t[0].type&&(e-=1),e>0&&(n+=1)}r.row+=1}return n}(t,n.col)&&(function(e,t){let n=0;for(;n"placeholder"!==e.type&&"first"!==e.type));e.parent()[t]=null,e.path.pop(),e.siblings().splice(e.anchorOffset(),0,...n),pl(e,e.anchorOffset()-1),e.announce("deleted: "+t)}else if("denom"===t){const t=e.parent().numer.filter((e=>"placeholder"!==e.type&&"first"!==e.type)),n=e.parent().denom.filter((e=>"placeholder"!==e.type&&"first"!==e.type));e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...n),e.siblings().splice(e.anchorOffset(),0,...t),pl(e,e.anchorOffset()+t.length-1),e.announce("deleted: denominator")}else if("body"===t){const t=e.siblings().filter((e=>"placeholder"!==e.type));e.path.length>1&&(t.shift(),e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...t),pl(e,e.anchorOffset()-1),e.announce("deleted: root"))}else ml(e,"backward"),Nc(e,-1)}else if(t>0)if(n!==r.length-1)/^(group|array|genfrac|surd|leftright|overlap|overunder|box|mathstyle|sizing)$/.test(e.sibling(1).type)?ml(e,"forward"):(e.announce("deleted",null,r.slice(n+1,n+2)),r.splice(n+1,1));else if("numer"===e.relation()){const t=e.parent().numer.filter((e=>"placeholder"!==e.type&&"first"!==e.type)),n=e.parent().denom.filter((e=>"placeholder"!==e.type&&"first"!==e.type));e.path.pop(),e.siblings().splice(e.anchorOffset(),1,...n),e.siblings().splice(e.anchorOffset(),0,...t),pl(e,e.anchorOffset()+t.length-1),e.announce("deleted: numerator")}else ml(e,"forward"),Nc(e,-1)}else{const t=e.startOffset()+1,n=e.endOffset()+1;e.announce("deleted",null,r.slice(t,n)),r.splice(t,n-t),pl(e,t-1)}Os(e),e.suppressChangeNotifications=n,nl(e),rl(e)}function Nc(e,t=0){if(0===t)Ic(e,0);else if(t>0)for(;t>0;)Ic(e,1),t--;else for(;t<0;)Ic(e,-1),t++;return!0}function Rc(e,t){e&&t&&(vs(e)?e.forEach((e=>Rc(e,t))):"object"==typeof e&&(e.color||e.backgroundColor||e.fontFamily||e.fontShape||e.fontSeries||e.fontSize||(e.applyStyle(t),Rc(e.body,t),Rc(e.numer,t),Rc(e.denom,t),Rc(e.index,t),Rc(e.overscript,t),Rc(e.underscript,t),Rc(e.subscript,t),Rc(e.superscript,t))))}function Bc(e,t){if(kl(e))return!1;function n(t,n){let r=!0;return Cl(e,(e=>{r=r&&e[t]===n}),{recursive:!0}),r}return t.color&&n("color",t.color)&&(t.color="none"),t.backgroundColor&&n("backgroundColor",t.backgroundColor)&&(t.backgroundColor="none"),t.fontFamily&&n("fontFamily",t.fontFamily)&&(t.fontFamily="none"),t.series&&(t.fontSeries=t.series),t.fontSeries&&n("fontSeries",t.fontSeries)&&(t.fontSeries="auto"),t.shape&&(t.fontShape=t.shape),t.fontShape&&n("fontShape",t.fontShape)&&(t.fontShape="auto"),t.size&&(t.fontSize=t.size),t.fontSize&&n("fontSize",t.fontSize)&&(t.fontSize="size5"),Cl(e,(e=>e.applyStyle(t)),{recursive:!0}),rl(e),!0}function jc(e){e.root.forEach((e=>{!Array.isArray(e.body)||0!==e.body.length&&"first"===e.body[0].type||e.body.unshift(new gs(e.mode,"first")),!e.superscript||0!==e.superscript.length&&"first"===e.superscript[0].type||e.superscript.unshift(new gs(e.mode,"first")),!e.subscript||0!==e.subscript.length&&"first"===e.subscript[0].type||e.subscript.unshift(new gs(e.mode,"first")),!e.overscript||0!==e.overscript.length&&"first"===e.overscript[0].type||e.overscript.unshift(new gs(e.mode,"first")),!e.underscript||0!==e.underscript.length&&"first"===e.underscript[0].type||e.underscript.unshift(new gs(e.mode,"first")),!e.numer||0!==e.numer.length&&"first"===e.numer[0].type||e.numer.unshift(new gs(e.mode,"first")),!e.denom||0!==e.denom.length&&"first"===e.denom[0].type||e.denom.unshift(new gs(e.mode,"first")),!e.index||0!==e.index.length&&"first"===e.index[0].type||e.index.unshift(new gs(e.mode,"first"))}))}function $c(e,t,n){var r,o,i,a;if(null!==(r=n.smartFence)&&void 0!==r&&r){if(Fc(e,t,n.style))return void jc(e)}else{const n=e.parent();if("leftright"===(null==n?void 0:n.type)&&"?"===n.rightDelim&&e.endOffset()===e.siblings().length-1&&/^[)}\]|]$/.test(t))return n.rightDelim=t,ml(e,"forward"),jc(e),void rl(e)}const s=e.suppressChangeNotifications;n.suppressChangeNotifications&&(e.suppressChangeNotifications=!0);const l=e.suppressChangeNotifications;e.suppressChangeNotifications=!0,n.insertionMode||(n.insertionMode="replaceSelection"),n.selectionMode||(n.selectionMode="placeholder"),n.format||(n.format="auto"),n.macros=null!==(o=n.macros)&&void 0!==o?o:e.options.macros;const c=n.mode||dl(e);let d;const u=[ys("math",bl(e)).toLatex(!1)],p=null!==(i=n.placeholder)&&void 0!==i?i:"\\placeholder{}";u["?"]=p,"replaceSelection"!==n.insertionMode||kl(e)?"replaceAll"===n.insertionMode?(e.root.body=[],e.root.latex="",e.path=[{relation:"body",offset:0}],e.extent=0):"insertBefore"===n.insertionMode?Sl(e):"insertAfter"===n.insertionMode&&Ml(e):Nc(e);const h=e.siblings(),f=e.startOffset();if(f+10&&h[f]&&"placeholder"===h[f].type&&Nc(e,-1),"math"===c&&"ASCIIMath"===n.format)[,t]=Js(t,{format:"ASCIIMath"}),d=_s(t,"math",null,null==n?void 0:n.macros,!1,e.listeners.onError),qc(e,d);else if("text"===c||"auto"!==n.format&&"latex"!==n.format)"text"!==c&&"text"!==n.format||(d=_s(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\\/g,"\\textbackslash ")).replace(/#/g,"\\#")).replace(/\$/g,"\\$")).replace(/%/g,"\\%")).replace(/&/g,"\\&")).replace(/_/g,"\\_")).replace(/{/g,"\\textbraceleft ")).replace(/}/g,"\\textbraceright ")).replace(/\^/g,"\\textasciicircum ")).replace(/~/g,"\\textasciitilde ")).replace(/£/g,"\\textsterling "),"text",u,n.macros,!1,e.listeners.onError));else if("command"===c){d=[];for(const e of t)la.test(e)&&d.push(new gs("command","command",e))}else if(""===t)d=[new gs("command","command","\\")];else{if("auto"===n.format&&([n.format,t]=Js(t)),u[0])t=t.replace(/(^|[^\\])#@/g,"$1#0");else if(/(^|[^\\])#@/.test(t)){const n=function(e){const t=e.siblings();let n=e.startOffset();if("text"===t[n].mode)for(;n>=1&&"text"===t[n].mode;)n--;else for(;n>=1&&/^(mord|surd|msubsup|leftright|mop)$/.test(t[n].type);)n--;return n}(e);t=t.replace(/(^|[^\\])#@/g,"$1"+function(e,t,n){const r=e.siblings();if(Cs(r))return"";if("first"===r[0].type&&0===t&&(t=1),"root"===e.parent().type&&1===t&&n===r.length-1)return e.parent().toLatex(!1);let o="",i=t;for(;i<=n;)o+=r[i].toLatex(!1),i++;return o}(e,n+1,e.startOffset())),function(e,t){t>0?e.siblings().splice(e.anchorOffset()+1,t):(e.siblings().splice(e.anchorOffset()+t+1,-t),pl(e,e.anchorOffset()+t))}(e,n-e.startOffset())}else t=t.replace(/(^|[^\\])#@/g,"$1#?");/^\$\$(.*)\$\$$/.test(t)&&(t=t.substring(2,t.length-2)),u[0]||(u[0]=p),d=_s(t,c,u,n.macros,null!==(a=n.smartFence)&&void 0!==a&&a,e.listeners.onError),"latex"!==n.format&&qc(e,d)}Os(e),Rc(d,n.style);const m=e.parent();if("latex"!==n.format&&e.options.removeExtraneousParentheses&&m&&"leftright"===m.type&&"("===m.leftDelim&&Cs(m.body)&&d&&1===d.length&&"genfrac"===d[0].type?(e.path.pop(),e.siblings()[e.anchorOffset()]=d[0]):("latex"!==n.format||1!==u.length||u[0]||"root"===m.type&&Cs(m.body)&&(m.latex=t),e.siblings().splice(e.anchorOffset()+1,0,...d)),jc(e),e.suppressChangeNotifications=l,"placeholder"===n.selectionMode){const t=[];for(const e of d)e.forEach((e=>{"placeholder"===e.type&&t.push(e)}));0!==t.length&&ul(e,1,!1)?e.announce("move"):pl(e,e.anchorOffset()+d.length)}else"before"===n.selectionMode||("after"===n.selectionMode?pl(e,e.anchorOffset()+d.length):"item"===n.selectionMode&&pl(e,e.anchorOffset(),d.length));rl(e),e.suppressChangeNotifications=s}function Kc(e){if(e)return 1===e.length&&"leftright"===e[0].type&&"("===e[0].leftDelim&&(e=e[0].body),e}function qc(e,t){if(t&&e.options.removeExtraneousParentheses){for(let e=0;t[e];e++)if("leftright"===t[e].type&&"("===t[e].leftDelim&&vs(t[e].body)){let n=0,r=0,o=0;for(let i=0;t[e].body[i];i++)"genfrac"===t[e].body[i].type&&(n++,r=i),"first"!==t[e].body[i].type&&o++;0===o&&1===n&&(t[e]=t[e].body[r])}t.forEach((t=>{if("genfrac"===t.type&&(qc(e,t.numer),qc(e,t.denom),t.numer=Kc(t.numer),t.denom=Kc(t.denom)),t.superscript&&(qc(e,t.superscript),t.superscript=Kc(t.superscript)),t.subscript&&(qc(e,t.subscript),t.subscript=Kc(t.subscript)),t.underscript&&(qc(e,t.underscript),t.underscript=Kc(t.underscript)),t.overscript&&(qc(e,t.overscript),t.overscript=Kc(t.overscript)),t.index&&(qc(e,t.index),t.index=Kc(t.index)),"surd"===t.type?(qc(e,t.body),t.body=Kc(t.body)):vs(t.body)&&qc(e,t.body),t.array)for(let n=js(t.array);n>=0;n--)qc(e,Bs(t.array,n))}))}}function Fc(e,t,n){const r=e.parent();let o="leftright"===r.type?r.leftDelim+r.rightDelim:"";if("\\lbrace\\rbrace"===o&&(o="{}"),"\\{\\}"===o&&(o="{}"),"{}"===o&&/\||\\vert|\\Vert|\\mvert|\\mid/.test(t))return $c(e,"\\,\\middle"+t+"\\, ",{mode:"math",format:"latex",style:n}),!0;"{"!==t&&"\\{"!==t||(t="\\lbrace"),"}"!==t&&"\\}"!==t||(t="\\rbrace"),"["===t&&(t="\\lbrack"),"]"===t&&(t="\\rbrack");const i=aa[t];if(i&&("leftright"!==r.type||"|"!==r.leftDelim)){let r="";const o=kl(e)||"placeholder"===ol(e).type;r=e.sibling(0).isFunction?"\\mleft"+t+"\\mright":"\\left"+t+"\\right",r+=o?"?":i;let a=[];return o&&(a=e.siblings().splice(e.anchorOffset()+1,e.siblings().length)),$c(e,r,{mode:"math",format:"latex",style:n}),o&&(e.sibling(0).body=a,ml(e,"backward")),!0}let a;if(Object.keys(aa).forEach((e=>{t===aa[e]&&(a=e)})),a){if(r&&"leftright"===r.type&&e.endOffset()===e.siblings().length-1)return r.rightDelim=t,ml(e,"forward"),rl(e),!0;const o=e.siblings();let i;for(i=e.endOffset();i>=0&&("leftright"!==o[i].type||"?"!==o[i].rightDelim);i--);if(i>=0)return o[i].rightDelim=t,o[i].body=o[i].body.concat(o.slice(i+1,e.endOffset()+1)),o.splice(i+1,e.endOffset()-i),pl(e,i),rl(e),!0;if(r&&"leftright"===r.type&&"?"===r.rightDelim){r.rightDelim=t;const n=o.slice(e.endOffset()+1);return o.splice(e.endOffset()+1),e.path.pop(),e.siblings().splice(e.endOffset()+1,0,...n),rl(e),!0}const a=e.ancestor(2);return!(!a||"leftright"!==a.type||"?"!==a.rightDelim||e.endOffset()!==o.length-1)&&(ml(e,"forward"),Fc(e,t,n))}return!1}Lc({performWithFeedback:(e,t)=>function(e,t){return e.focus(),e.options.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),"moveToNextPlaceholder"===(t=t.replace(/-\w/g,(e=>e[1].toUpperCase())))||"moveToPreviousPlaceholder"===t||"complete"===t?e.returnKeypressSound?(e.returnKeypressSound.load(),e.returnKeypressSound.play().catch((e=>console.warn(e)))):e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch((e=>console.warn(e)))):"deletePreviousChar"!==t&&"deleteNextChar"!==t&&"deletePreviousWord"!==t&&"deleteNextWord"!==t&&"deleteToGroupStart"!==t&&"deleteToGroupEnd"!==t&&"deleteToMathFieldStart"!==t&&"deleteToMathFieldEnd"!==t||!e.deleteKeypressSound?e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch((e=>console.warn(e)))):(e.deleteKeypressSound.load(),e.deleteKeypressSound.play().catch((e=>console.warn(e)))),e.executeCommand(t)}(e,t)}),Lc({addRowAfter:Dc,addColumnAfter:Pc,addRowBefore:function(e){return Ac(e),Tc(e,"before row"),rl(e),!0},addColumnBefore:function(e){return Ac(e),Tc(e,"before column"),rl(e),!0}},{target:"model",category:"array-edit"});class Hc{constructor(e){this.positions=[],this.root=e;const t=new Zc;t.root=e,jc(t);do{this.positions.push({path:t.toString(),atom:Uc(t),depth:t.path.length})}while(Wc(t))}at(e){return this.positions[e]}find(e){for(let t=0;tthis.at(e).path))}}function Wc(e){const t={body:"numer",numer:"denom",denom:"index",index:"overscript",overscript:"underscript",underscript:"subscript",subscript:"superscript"};if(e.anchorOffset()===e.siblings(!1).length-1){let n=t[e.relation()];const r=e.parent();for(;n&&!r[n];)n=t[n];if(n)return Vc(e,0,n),!0;if(e.parent().array){const t=js(e.parent().array);let n=parseInt(e.relation().match(/cell([0-9]*)$/)[1])+1;for(;n{},moveOut:(null==e?void 0:e.moveOut)?e.moveOut:()=>!0,tabOut:(null==e?void 0:e.tabOut)?e.tabOut:()=>!0}}get selection(){const e=ol(this);let t;if(this.parent().array)t=Bs(this.parent().array,this.relation())[this.focusOffset()];else{const e=this.siblings();t=e[Math.min(e.length-1,this.focusOffset())]}const n=new Hc(this.root);return[Ts(n,{start:n.find(e),end:n.find(t)})]}set selection(e){!function(e,t){const n=Array.isArray(t)?t[0]:t,r=new Hc(e.root);let o;n.direction||(n.direction="forward"),(n.start<0||n.start>r.lastPosition)&&(n.start=r.lastPosition),void 0===n.end&&(n.end=n.start),(n.end<0||n.end>r.lastPosition)&&(n.end=r.lastPosition),o="backward"===n.direction?r.at(n.end).path:r.at(n.start).path,il(e,o,n.end-n.start)}(this,e)}get lastPosition(){return new Hc(this.root).lastPosition}announce(e,t,n=[]){this.hooks.announce(this.mathfield,e,t,n)}toString(){return As(this.path,this.extent)}siblings(e=!0){var t;if(0===this.path.length)return[];let n;return this.parent().array?n=Bs(this.parent().array,this.relation()):(n=null!==(t=this.parent()[this.relation()])&&void 0!==t?t:[],"string"==typeof n&&(n=[])),!e||0!==n.length&&"first"===n[0].type||n.unshift(new gs(this.parent().mode,"first")),n}anchorOffset(){return this.path.length>0?this.path[this.path.length-1].offset:0}focusOffset(){return this.path.length>0?this.path[this.path.length-1].offset+this.extent:0}groupIsSelected(){return 0===this.startOffset()&&this.endOffset()>=this.siblings().length-1}startOffset(){return Math.min(this.focusOffset(),this.anchorOffset())}endOffset(){return Math.max(this.focusOffset(),this.anchorOffset())}sibling(e){return this.siblings()[this.startOffset()+e]}ancestor(e){if(e>this.path.length)return null;let t=this.root;for(let n=0;n0?this.path[this.path.length-1].relation:""}insertFirstAtom(){this.siblings()}}function Gc(e){if(Ml(e),!ol(e).superscript)if(ol(e).subscript)ol(e).superscript=[new gs(e.parent().mode,"first")];else{const t=e.sibling(1);(null==t?void 0:t.superscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.subscript)?(e.path[e.path.length-1].offset+=1,ol(e).superscript=[new gs(e.parent().mode,"first")]):("limits"!==ol(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new gs(e.parent().mode,"msubsup","​",sl(e))),e.path[e.path.length-1].offset+=1),ol(e).superscript=[new gs(e.parent().mode,"first")])}return e.path.push({relation:"superscript",offset:0}),xl(e),!0}Lc({moveToOpposite:e=>{const t={superscript:"subscript",subscript:"superscript",denom:"numer",numer:"denom"}[e.relation()];return t||Gc(e),e.parent()[t]||(e.parent()[t]=[new gs(e.parent().mode,"first")]),pl(e,0,"end",t),!0},moveBeforeParent:e=>e.path.length>1?(e.path.pop(),pl(e,e.anchorOffset()-1),!0):(e.announce("plonk"),!1),moveAfterParent:e=>El(e),moveToNextPlaceholder:e=>ul(e,1),moveToPreviousPlaceholder:e=>ul(e,-1),moveToNextChar:e=>ml(e,"forward"),moveToPreviousChar:e=>ml(e,"backward"),moveUp:e=>ml(e,"upward"),moveDown:e=>ml(e,"downward"),moveToNextWord:e=>yl(e,1),moveToPreviousWord:e=>yl(e,-1),moveToGroupStart:e=>pl(e,0),moveToGroupEnd:e=>pl(e,-1),moveToMathFieldStart:e=>vl(e,-1),moveToMathFieldEnd:e=>vl(e,1),moveToSuperscript:e=>Gc(e),moveToSubscript:e=>function(e){if(Ml(e),!ol(e).subscript)if(ol(e).superscript)ol(e).subscript=[new gs(e.parent().mode,"first")];else{const t=e.sibling(1);(null==t?void 0:t.subscript)?e.path[e.path.length-1].offset+=1:(null==t?void 0:t.superscript)?(e.path[e.path.length-1].offset+=1,ol(e).subscript=[new gs(e.parent().mode,"first")]):("limits"!==ol(e).limits&&(e.siblings().splice(e.anchorOffset()+1,0,new gs(e.parent().mode,"msubsup","​",sl(e))),e.path[e.path.length-1].offset+=1),ol(e).subscript=[new gs(e.parent().mode,"first")])}return e.path.push({relation:"subscript",offset:0}),xl(e),!0}(e)},{target:"model",category:"selection-anchor"}),Lc({selectGroup:e=>xl(e),selectAll:e=>wl(e),extendToNextChar:e=>gl(e,1),extendToPreviousChar:e=>gl(e,-1),extendToNextWord:e=>yl(e,1,{extend:!0}),extendToPreviousWord:e=>yl(e,-1,{extend:!0}),extendUp:e=>ml(e,"upward",{extend:!0}),extendDown:e=>ml(e,"downward",{extend:!0}),extendToNextBoundary:e=>yl(e,1,{extend:!0}),extendToPreviousBoundary:e=>yl(e,-1,{extend:!0}),extendToGroupStart:e=>(_l(e,-e.anchorOffset()),!0),extendToGroupEnd:e=>(_l(e,e.siblings().length-e.anchorOffset()),!0),extendToMathFieldStart:e=>vl(e,-1,{extend:!0}),extendToMathFieldEnd:e=>vl(e,1,{extend:!0})},{target:"model",category:"selection-extend"}),Lc({deleteAll:e=>(wl(e),Nc(e)),deleteNextChar:e=>Nc(e,1),deletePreviousChar:e=>Nc(e,-1),deleteNextWord:e=>(yl(e,1,{extend:!0}),Nc(e)),deletePreviousWord:e=>(yl(e,-1,{extend:!0}),Nc(e)),deleteToGroupStart:e=>(_l(e,-e.anchorOffset()),Nc(e)),deleteToGroupEnd:e=>(vl(e,-1,{extend:!0}),Nc(e)),deleteToMathFieldStart:e=>(vl(e,-1,{extend:!0}),Nc(e)),deleteToMathFieldEnd:e=>(vl(e,1,{extend:!0}),Nc(e))},{target:"model",category:"delete"});const Xc=["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"];function Yc(e){return!e.ctrlKey&&!e.metaKey&&"Dead"!==e.key&&(""===e.code||Xc.indexOf(e.code)>=0)}function Jc(e){const t=[];return(e=function(e){if(!e.code){const t=Object.entries(Bl().mapping);let n,r=!1,o=!1;for(let i=0;i<4;i++){for(const[a,s]of t)if(s[i]===e.key){n=a,3===i?(r=!0,o=!0):2===i?r=!0:1===i&&(o=!0);break}if(n)break}return new KeyboardEvent(e.type,{...e,altKey:r,shiftKey:o,code:n})}return new KeyboardEvent(e.type,e)}(e)).ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),0===t.length?"["+e.code+"]":(t.push("["+e.code+"]"),t.join("+"))}function Qc(e=document){var t,n;return(null===(n=null===(t=e.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.activeElement)?Qc(e.activeElement.shadowRoot):e.activeElement}function ed(e){var t;if(!e)return"";let n;return"Unidentified"===e.key&&e.target&&(n=e.target.value),n=null!==(t=null!=n?n:e.key)&&void 0!==t?t:e.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(n)&&(n=""),n}class td{constructor(e){this.maximumDepth=1e3,this.record=!1,this.canCoalesce=!1,this.model=e,this.reset()}reset(){this.stack=[],this.index=-1}startRecording(){this.record=!0}canUndo(){return this.index>0}canRedo(){return this.index!==this.stack.length-1}undo(e){this.canUndo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.model.mathfield,"undo"),this.restore(this.stack[this.index-1],e),this.index-=1,e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.model.mathfield,"undo"),this.canCoalesce=!1)}redo(e){this.canRedo()&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.model.mathfield,"redo"),this.index+=1,this.restore(this.stack[this.index],e),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.model.mathfield,"redo"),this.canCoalesce=!1)}pop(){this.canUndo()&&(this.index-=1,this.stack.pop())}snapshot(e){this.record&&("function"==typeof(null==e?void 0:e.onUndoStateWillChange)&&e.onUndoStateWillChange(this.model.mathfield,"snapshot"),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push({latex:this.model.root.toLatex(!1),selection:this.model.selection}),this.index++,this.stack.length>this.maximumDepth&&this.stack.shift(),e&&"function"==typeof e.onUndoStateDidChange&&e.onUndoStateDidChange(this.model.mathfield,"snapshot"),this.canCoalesce=!1)}snapshotAndCoalesce(e){this.canCoalesce&&this.pop(),this.snapshot(e),this.canCoalesce=!0}save(){return{latex:this.model.root.toLatex(!1),selection:this.model.selection}}restore(e,t){const n=this.model.suppressChangeNotifications;void 0!==t.suppressChangeNotifications&&(this.model.suppressChangeNotifications=t.suppressChangeNotifications),$c(this.model,e?e.latex:"",{...t,format:"latex",mode:"math",insertionMode:"replaceAll",selectionMode:"after",smartFence:!1}),this.model.selection=e?e.selection:[{start:0}],this.model.suppressChangeNotifications=n}}const nd={"−":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega"},rd={"\\pm":"+-","\\times":"xx","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrace":"{","\\rbrace":"}","\\langle":"(:","\\rangle":":)"};function od(e){if(!e)return"";if(si(e)){let t="";if(0===e.length)return"";if("first"===e[0].type&&(e=e.slice(1)),0===e.length)return"";if("text"===e[0].mode){let n=0;for(t='"';e[n]&&"text"===e[n].mode;)t+=e[n].body,n++;t+='"'+od(e.slice(n))}else if("math"===e[0].mode){let n=0;for(;e[n]&&"math"===e[n].mode;)t+=od(e[n]),n++;t+=od(e.slice(n))}else console.warn("toASCIIMath: Unexpected mode");return t.trim()}if("text"===e.mode)return'"'+e.body+'"';let t="";const n=e.symbol;let r;switch(e.type){case"group":case"root":t=od(e.body);break;case"array":case"sizeddelim":case"delim":case"overlap":case"overunder":case"mathstyle":case"box":case"spacing":case"enclose":break;case"genfrac":(e.leftDelim||e.rightDelim)&&(t+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:"),e.hasBarLine?(t+="(",t+=od(e.numer),t+=")/(",t+=od(e.denom),t+=")"):(t+="("+od(e.numer)+"),",t+="("+od(e.denom)+")"),(e.leftDelim||e.rightDelim)&&(t+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:"{:");break;case"surd":e.index?t+="root("+od(e.index)+")("+od(e.body)+")":t+="sqrt("+od(e.body)+")";break;case"leftright":t+="."!==e.leftDelim&&e.leftDelim?e.leftDelim:"{:",t+=od(e.body),t+="."!==e.rightDelim&&e.rightDelim?e.rightDelim:":}";break;case"mord":t=nd[n]||n||("string"==typeof e.body?e.body:""),"\\"===t[0]&&(t=String(t)),r=n?n.match(/[{]?\\char"([0-9abcdefABCDEF]*)[}]?/):null,r?t=String.fromCharCode(parseInt("0x"+r[1])):t.length>0&&"\\"===t.charAt(0)&&(t="string"==typeof e.body?e.body.charAt(0):e.symbol);break;case"mbin":case"mrel":case"textord":case"minner":t=n&&nd[n]?nd[n]:n&&rd[n]?rd[n]:e.body;break;case"mopen":case"mclose":t+=e.body;break;case"mpunct":t=rd[n]||n;break;case"mop":"​"!==e.body&&(t="",t+="\\operatorname"===n?od(e.body):e.body||n,t+=" ");break;case"space":t=" "}if(e.subscript){t+="_";const n=od(e.subscript);n.length>1&&!/^(-)?\d+(\.\d*)?$/.test(n)?t+="("+n+")":t+=n}if(e.superscript){t+="^";const n=od(e.superscript);n.length>1&&!/^(-)?\d+(\.\d*)?$/.test(n)?t+="("+n+")":t+=n}return t}const id={};function ad(e){const t=id.locale.substring(0,2);let n="";return id.strings[id.locale]&&(n=id.strings[id.locale][e]),!n&&id.strings[t]&&(n=id.strings[t][e]),n||(n=id.strings.en[e]),n||(n=e),n}function sd(e,t,n){Ls(e);const r=[],o=t.substr(n);for(const e of o){const t=new gs("command","command",e);t.isSuggestion=!0,r.push(t)}Array.prototype.splice.apply(e.siblings(),[e.anchorOffset()+1,0].concat(r))}function ld(e,t){if(t=null!=t?t:{acceptSuggestion:!1},rc(e),t.discard)return ac(e.model,null),e.switchMode("math"),!0;const n=oc(e.model,!t.acceptSuggestion);if(n){if("\\("===n||"\\)"===n)ac(e.model,[]),$c(e.model,n.slice(1),{mode:e.mode});else{e.switchMode("math");const t=_s(n,"math",null,e.options.macros);t?ac(e.model,t):ic(e.model,!0)}return e.snapshot(),e.model.announce("replacement"),!0}return!1}function cd(e){!function(e){const t=e.siblings(),n=cl(e);let r=n.start;for(;r1)}return Ec(e),!0}id.plural=function(e,t,n){var r;(n=null!=n?n:{}).type=null!==(r=n.type)&&void 0!==r?r:"cardinal";const o=id.locale.substring(0,2),i="ordinal"===n.type?id._ordinal:id._cardinal;let a,s="ordinal"===n.type?id._ordinalPluralCategories.indexOf(i.select(e)):id._cardinalPluralCategories.indexOf(i.select(e));return id.strings[id.locale]&&(a=id.strings[id.locale][t]),!a&&id.strings[o]&&(a=id.strings[o][t]),a||(a=id.strings.en[t],a||(a=t),s="ordinal"===n.type?id._ordinalPluralCategories.indexOf(id._ordinalEnglish.select(e)):id._cardinalPluralCategories.indexOf(id._cardinalEnglish.select(e))),a.split(";")[s]||a.split(";")[0]},id.merge=function(e,t){if(e&&t){const n=id._locale;id.locale=e,id.strings[e]={...id.strings[e],...t},id.locale=n}else e&&!t&&Object.keys(e).forEach((t=>id.merge(t,e[t])))},Object.defineProperty(id,"locale",{set(e){id._locale=e,id._ordinal=null,id._cardinal=null},get(){var e;return id._locale||(id._locale=null!==(e=null===navigator||void 0===navigator?void 0:navigator.language.slice(0,5))&&void 0!==e?e:"en"),id._locale}}),Object.defineProperty(id,"ordinal",{get:()=>(id._ordinal||(id._ordinalEnglish=new Intl.PluralRules("en",{type:"ordinal"}),id._ordinalEnglishPluralCategories=id._ordinalEnglish.resolvedOptions().pluralCategories,id._ordinal=new Intl.PluralRules(id.locale,{type:"ordinal"}),id._ordinalPluralCategories=id._ordinal.resolvedOptions().pluralCategories),id._ordinal)}),Object.defineProperty(id,"cardinal",{get:()=>(id._cardinal||(id._cardinalEnglish=new Intl.PluralRules("en",{type:"cardinal"}),id._cardinalEnglishPluralCategories=id._cardinalEnglish.resolvedOptions().pluralCategories,id._cardinal=new Intl.PluralRules(id.locale,{type:"cardinal"}),id._cardinalPluralCategories=id._ordinal.resolvedOptions().pluralCategories),id._cardinal)}),id.strings={en:{"keyboard.tooltip.functions":"Functions","keyboard.tooltip.symbols":"Symbols","keyboard.tooltip.greek":"Greek Letters","keyboard.tooltip.command":"LaTeX Command Mode","keyboard.tooltip.numeric":"Numeric","keyboard.tooltip.roman":"Roman Letters","tooltip.copy to clipboard":"Copy to Clipboard","tooltip.redo":"Redo","tooltip.toggle virtual keyboard":"Toggle Virtual Keyboard","tooltip.undo":"Undo"},ar:{"keyboard.tooltip.functions":"مهام","keyboard.tooltip.symbols":"حرف او رمز","keyboard.tooltip.greek":"حروف يونانية","keyboard.tooltip.command":"حالة تلقي الأوامر اللاتك","keyboard.tooltip.numeric":"الرقمية","keyboard.tooltip.roman":"رموز الاحرف الرومانية","tooltip.copy to clipboard":"نسخ إلى الحافظة","tooltip.redo":"الإعادة","tooltip.toggle virtual keyboard":"تبديل لوحة المفاتيح الإفتراضية","tooltip.undo":"إلغاء"},de:{"keyboard.tooltip.functions":"Funktionen","keyboard.tooltip.symbols":"Symbole","keyboard.tooltip.greek":"Griechische Buchstaben","keyboard.tooltip.command":"LaTeX-Befehlsmodus","keyboard.tooltip.numeric":"Numerisch","keyboard.tooltip.roman":"Römische Buchstaben","tooltip.copy to clipboard":"In die Zwischenablage kopieren","tooltip.redo":"Wiederholen","tooltip.toggle virtual keyboard":"Virtuelle Tastatur umschalten","tooltip.undo":"Widerrufen"},el:{"keyboard.tooltip.functions":"συναρτήσεις","keyboard.tooltip.symbols":"σύμβολα","keyboard.tooltip.greek":"ελληνικά γράμματα","keyboard.tooltip.command":"Λειτουργία εντολών LaTeX","keyboard.tooltip.numeric":"Αριθμητικός","keyboard.tooltip.roman":"Ρωμαϊκά γράμματα","tooltip.copy to clipboard":"Αντιγραφή στο πρόχειρο","tooltip.redo":"Ξανακάνω","tooltip.toggle virtual keyboard":"Εναλλαγή εικονικού πληκτρολογίου","tooltip.undo":"Ξεκάνω"},es:{"keyboard.tooltip.functions":"Funciones","keyboard.tooltip.symbols":"Símbolos","keyboard.tooltip.greek":"Letras griegas","keyboard.tooltip.command":"Modo Comando LaTeX","keyboard.tooltip.numeric":"Numérico","keyboard.tooltip.roman":"Letras romanas","tooltip.copy to clipboard":"Copiar al portapapeles","tooltip.redo":"Rehacer","tooltip.toggle virtual keyboard":"Alternar teclado virtual","tooltip.undo":"Deshacer"},fa:{"keyboard.tooltip.functions":"توابع","keyboard.tooltip.symbols":"نمادها","keyboard.tooltip.greek":"حروف یونانی","keyboard.tooltip.command":"حالت دستور لاتک","keyboard.tooltip.numeric":"عددی","keyboard.tooltip.roman":"حروف رومی","tooltip.copy to clipboard":"کپی به کلیپبورد","tooltip.redo":"بازگشت به بعد","tooltip.toggle virtual keyboard":"نمایش/نهفتن کیبورد مجازی","tooltip.undo":"بازگشت به قبل"},fr:{"keyboard.tooltip.functions":"Fonctions","keyboard.tooltip.symbols":"Symboles","keyboard.tooltip.greek":"Lettres grecques","keyboard.tooltip.command":"Mode de commandes LaTeX","keyboard.tooltip.numeric":"Numérique","keyboard.tooltip.roman":"Lettres romaines","tooltip.copy to clipboard":"Copier dans le presse-papiers","tooltip.redo":"Rétablir","tooltip.toggle virtual keyboard":"Afficher/Masquer le clavier virtuel","tooltip.undo":"Annuler"},it:{"keyboard.tooltip.functions":"Funzioni","keyboard.tooltip.symbols":"Simboli","keyboard.tooltip.greek":"Lettere greche","keyboard.tooltip.command":"Modalità di comando LaTeX","keyboard.tooltip.numeric":"Numerico","keyboard.tooltip.roman":"Lettere romane","tooltip.copy to clipboard":"Copia negli appunti","tooltip.redo":"Rifare","tooltip.toggle virtual keyboard":"Attiva / disattiva la tastiera virtuale","tooltip.undo":"Disfare"},ja:{"keyboard.tooltip.functions":"関数","keyboard.tooltip.symbols":"シンボル","keyboard.tooltip.greek":"ギリシャ文字","keyboard.tooltip.command":"LaTeXコマンドモード","keyboard.tooltip.numeric":"数値","keyboard.tooltip.roman":"ローマ字","tooltip.copy to clipboard":"クリップボードにコピー","tooltip.redo":"やり直し","tooltip.toggle virtual keyboard":"仮想キーボードの切り替え","tooltip.undo":"元に戻す"},pl:{"keyboard.tooltip.functions":"Funkcje","keyboard.tooltip.symbols":"Symbolika","keyboard.tooltip.greek":"Litery greckie","keyboard.tooltip.command":"Tryb poleceń LaTeX","keyboard.tooltip.numeric":"Numeryczne","keyboard.tooltip.roman":"Litery rzymskie","tooltip.copy to clipboard":"Kopiuj do Schowka","tooltip.redo":"Przywróć","tooltip.toggle virtual keyboard":"Przełącz wirtualną klawiaturę","tooltip.undo":"Cofnij"},ru:{"keyboard.tooltip.functions":"Функции","keyboard.tooltip.symbols":"Символы","keyboard.tooltip.greek":"Греческие буквы","keyboard.tooltip.command":"Режим командной строки LaTeX","keyboard.tooltip.numeric":"числовой","keyboard.tooltip.roman":"Латинские буквы","tooltip.copy to clipboard":"Скопировать в буфер обмена","tooltip.redo":"переделывать","tooltip.toggle virtual keyboard":"Переключить виртуальную клавиатуру","tooltip.undo":"расстегивать"}},Lc({complete:ld,nextSuggestion:function(e){return e.suggestionIndex+=1,cd(e),!1},previousSuggestion:function(e){if(e.suggestionIndex-=1,e.suggestionIndex<0){Ls(e.model);const t=_a(oc(e.model));e.suggestionIndex=t.length-1}return cd(e),!1}},{target:"mathfield",category:"autocomplete"});const dd={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"eye ","\\sum":"Summation ","\\prod":"Product ",a:'a',A:'capital A',"+":"plus ","-":"minus ",";":' semi-colon ',",":' comma ',"|":'Vertical bar',"(":'Open paren. ',")":' Close paren. ',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","​":"","−":"minus ",":":' such that ',"\\colon":' such that ',"\\hbar":"etch bar ","\\iff":'if, and only if, ',"\\Longleftrightarrow":'if, and only if, ',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set n',"\\C":'the set c',"\\Z":'the set z',"\\Q":'the set q',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lbrace":'open brace',"\\{":'open brace',"\\rbrace":'close brace',"\\}":'close brace',"\\langle":'left angle bracket',"\\rangle":'right angle bracket',"\\lfloor":'open floor',"\\rfloor":'close floor',"\\lceil":'open ceiling',"\\rceil":'close ceiling',"\\vert":'vertical bar',"\\mvert":'divides',"\\lvert":'left vertical bar',"\\rvert":'right vertical bar',"\\lbrack":' open square bracket ',"\\rbrack":' close square bracket ',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"};function ud(e){let t=0;if(vs(e))for(const n of e)"first"!==n.type&&(t+=1);return 1===t}function pd(e){let t="";if(vs(e))for(const n of e)"first"!==n.type&&"string"==typeof n.body&&(t+=n.body);return t}function hd(e,t,n){function r(e){return""+e+""}if(!t)return"";let o="";if(vs(t)){let i=!1,a=!1;for(let s=0;s'),o+=t.body;else{t.id&&"math"===e&&(o+='');let i="",a="",s="",l=!1;switch(t.type){case"group":case"root":o+=hd("math",t.body,n);break;case"genfrac":if(i=hd("math",t.numer,n),a=hd("math",t.denom,n),ud(t.numer)&&ud(t.denom)){const e={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[pd(t.numer)+"/"+pd(t.denom)];e?o=e:o+=i+" over "+a}else o+=' the fraction '+i+', over '+a+'. End fraction.';break;case"surd":if(s=hd("math",t.body,n),t.index){let e=hd("math",t.index,n);e=e.trim();const r=e.replace(//g,"");o+="3"===r?' the cube root of '+s+'. End cube root':"n"===r?' the nth root of '+s+'. End root':' the root with index: '+e+', of '+s+'. End root'}else ud(t.body)?o+=" the square root of "+s+" , ":o+=' the square root of '+s+'. End square root';break;case"leftright":o+=dd[t.leftDelim]||t.leftDelim,o+=hd("math",t.body,n),o+=dd[t.rightDelim]||t.rightDelim;break;case"rule":case"overunder":case"overlap":break;case"placeholder":o+="placeholder "+t.body;break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":case"textord":{const r=t.symbol;if("\\mathbin"===r||"\\mathrel"===r||"\\mathopen"===r||"\\mathclose"===r||"\\mathpunct"===r||"\\mathord"===r||"\\mathinner"===r){o=hd(e,t.body,n);break}let i=t.body,a=t.symbol;if("delim"!==t.type&&"sizeddelim"!==t.type||(i=a=t.delim),"text"===e)o+=i;else{if("mbin"===t.type&&(o+=''),i){const e=dd[i]||(a?dd[a.trim()]:"");if(e)o+=" "+e;else{const e=a?function(e){let t="";return"\\"===e.charAt(0)&&(t=" "+e.replace("\\","")+" "),t}(a.trim()):"";o+=e||function(e){let t="";return n.textToSpeechMarkup?/[a-z]/.test(e)?t+=' '+e+"":/[A-Z]/.test(e)?t+=String("capital "+e.toLowerCase()):t+=e:/[a-z]/.test(e)?t+=" '"+e.toUpperCase()+"'":/[A-Z]/.test(e)?t+=" 'capital "+e.toUpperCase()+"'":t+=e,t}(i)}}else o+=hd("math",t.body,n);"mbin"===t.type&&(o+='')}break}case"mop":if("​"!==t.body){const e=t.symbol;if("\\sum"===e)if(t.superscript&&t.subscript){let e=hd("math",t.superscript,n);e=e.trim();let r=hd("math",t.subscript,n);r=r.trim(),o+=' the summation from '+r+' to '+e+' of ',l=!0}else if(t.subscript){let e=hd("math",t.subscript,n);e=e.trim(),o+=' the summation from '+e+' of ',l=!0}else o+=" the summation of";else if("\\prod"===e)if(t.superscript&&t.subscript){let e=hd("math",t.superscript,n);e=e.trim();let r=hd("math",t.subscript,n);r=r.trim(),o+=' the product from '+r+' to '+e+' of ',l=!0}else if(t.subscript){let e=hd("math",t.subscript,n);e=e.trim(),o+=' the product from '+e+' of ',l=!0}else o+=" the product of ";else if("\\int"===e)if(t.superscript&&t.subscript){let e=hd("math",t.superscript,n);e=e.trim();let i=hd("math",t.subscript,n);i=i.trim(),o+=' the integral from '+r(i)+' to '+r(e)+' of ',l=!0}else o+=' the integral of ';else"string"==typeof t.body?o+=dd[t.body]||dd[t.symbol]||" "+t.body:t.symbol&&("\\"===t.symbol[0]?o+=" "+t.symbol.substr(1):o+=" "+t.symbol)}break;case"enclose":s=hd("math",t.body,n),ud(t.body)?o+=" crossed out "+s+" , ":o+=" crossed out "+s+". End cross out"}if(!l&&t.superscript){let r=hd(e,t.superscript,n);r=r.trim();const i=r.replace(/<[^>]*>/g,"");if(ud(t.superscript)){if("math"===e){const e=function(e){if(vs(e))for(const t of e)if("first"!==t.type&&t.id)return t.id.toString();return""}(t.superscript);e&&(o+='')}"′"===i?o+=" prime ":"2"===i?o+=" squared ":"3"===i?o+=" cubed ":isNaN(parseInt(i))?o+=" to the "+r+"; ":o+=' to the '+i+" power; "}else isNaN(parseInt(i))?o+=" raised to the "+r+"; ":o+=' raised to the '+i+" power; "}if(!l&&t.subscript){let e=hd("math",t.subscript,n);e=e.trim(),ud(t.subscript)?o+=" sub "+e:o+=" subscript "+e+". End subscript. "}}return o}function fd(e,t){var n;const r={...t,textToSpeechRulesOptions:{...t.textToSpeechRulesOptions}};if(window.sre&&"sre"===r.textToSpeechRules){const t=Mc(e,r);return t?(r.textToSpeechMarkup&&(r.textToSpeechRulesOptions=null!==(n=r.textToSpeechRulesOptions)&&void 0!==n?n:{},r.textToSpeechRulesOptions.markup=r.textToSpeechMarkup,"ssml"===r.textToSpeechRulesOptions.markup&&(r.textToSpeechRulesOptions.markup="ssml_step"),r.textToSpeechRulesOptions.rate=r.speechEngineRate),r.textToSpeechRulesOptions&&window.sre.System.getInstance().setupEngine(r.textToSpeechRulesOptions),window.sre.System.getInstance().toSpeech(t)):""}let o=hd("math",e,r);if("ssml"===r.textToSpeechMarkup){let e="";r.speechEngineRate&&(e=''),o=''+e+"

"+o+"

"+(e?"
":"")+""}else o="mac"===r.textToSpeechMarkup&&"mac"===function(e){let t="other";return(null===navigator||void 0===navigator?void 0:navigator.platform)&&(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&(/^(mac)/i.test(navigator.platform)?t="mac":/^(win)/i.test(navigator.platform)?t="win":/(android)/i.test(navigator.userAgent)?t="android":/(iphone)/i.test(navigator.userAgent)||/(ipod)/i.test(navigator.userAgent)||/(ipad)/i.test(navigator.userAgent)?t="ios":/\bCrOS\b/i.test(navigator.userAgent)&&(t="chromeos")),t===e?e:"!"+e}("mac")?o.replace(//g,"").replace(//g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(//g,"[[slc $1]]").replace(/]*>/g,"").replace(/<\/say-as>/g,""):o.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return o}function md(e,t,n){return t+fd(n,{...e,textToSpeechMarkup:"",textToSpeechRulesOptions:{...e.textToSpeechRulesOptions,markup:"none"}})}function gd(e,t,n,r){let o="";"plonk"===t?(e.plonkSound&&(e.plonkSound.load(),e.plonkSound.play().catch((e=>console.warn(e)))),e.resetKeystrokeBuffer()):"delete"===t?o=md(e.options,"deleted: ",r):"focus"===t||/move/.test(t)?o=(kl(e.model)?"":"selected: ")+function(e,t){function n(e,t){return"body"===t.relation?{enclose:"cross out",leftright:"fence",surd:"square root",root:"math field"}[e.type]:{numer:"numerator",denom:"denominator",index:"index",body:"parent",subscript:"subscript",superscript:"superscript"}[t.relation]}const r=t?t.path:[],o=e.model.path,i=o[o.length-1];let a="";for(;r.length>o.length;)a+="out of "+n(t.parent(),r[r.length-1])+"; ",r.pop();if(!kl(e.model))return md(e.options,"",bl(e.model));const s=n(e.model.parent(),i);0===i.offset&&(a+=(s?"start of "+s:"unknown")+": ");const l=e.model.sibling(Math.max(1,e.model.extent));return l?a+=md(e.options,"",l):0!==i.offset&&(a+=s?"end of "+s:"unknown"),a}(e,n):"replacement"===t?o=md(e.options,"",e.model.sibling(0)):"line"===t?(e.accessibleNode.innerHTML=e.options.createHTML(''+Mc(e.model.root,e.options)+""),o=md(e.options,"",e.model.root),e.keyboardDelegate.setAriaLabel("after: "+o)):o=r?md(e.options,t+" ",r):t;const i=/\u00a0/.test(e.ariaLiveText.textContent)?"   ":"   ";e.ariaLiveText.textContent=o+i}Lc({speak:(e,t,n)=>function(e,t,n){n=null!=n?n:{withHighlighting:!1};const r=function(e,t){let n=null;switch(t){case"all":n=e.model.root;break;case"selection":kl(e.model)||(n=bl(e.model));break;case"left":{const t=e.model.siblings(),r=e.model.startOffset();if(r>=1){n=[];for(let e=1;e<=r;e++)n.push(t[e])}break}case"right":{const t=e.model.siblings(),r=e.model.endOffset()+1;if(r<=t.length-1){n=[];for(let e=r;e<=t.length-1;e++)n.push(t[e])}break}case"group":n=e.model.siblings();break;case"parent":{const t=e.model.parent();t&&"root"!==t.type&&(n=e.model.parent());break}}return n}(e,t);if(null===r)return e.options.speakHook(function(e){let t="";switch(e){case"all":console.log("Internal failure: speak all failed");break;case"selection":t="no selection";break;case"left":t="at start";break;case"right":t="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":t="no parent";break;default:console.log('unknown speak_ param value: "'+e+'"')}return t}(t),e.options),!1;const o={...e.options};(n.withHighlighting||"amazon"===o.speechEngine)&&(o.textToSpeechMarkup=window.sre&&"sre"===o.textToSpeechRules?"ssml_step":"ssml");const i=fd(r,o);return n.withHighlighting?(window.mathlive.readAloudMathField=e,zc(e,{forHighlighting:!0}),e.options.readAloudHook&&e.options.readAloudHook(e.field,i,e.options)):e.options.speakHook&&e.options.speakHook(i,o),!1}(e,t,n)},{target:"mathfield",category:"speech"});const yd=()=>{};function vd(e){if("string"==typeof e){const t=new Audio;return t.preload="none",t.src=e,t.volume=.5,t}return e}function bd(e){e instanceof HTMLAudioElement&&(e.pause(),e.removeAttribute("src"),e.load())}function xd(e,t){const n=wd(e,Object.keys(e));return Object.keys(t).forEach((e=>{var r,o,i;switch(e){case"scriptDepth":if(si(t.scriptDepth))n.scriptDepth=[t.scriptDepth[0],t.scriptDepth[1]];else{if("number"!=typeof t.scriptDepth)throw Error("Unexpected value for scriptDepth");n.scriptDepth=[t.scriptDepth,t.scriptDepth]}break;case"namespace":if(!/^[a-z]*[-]?$/.test(t.namespace))throw Error("namespace must be a string of lowercase characters only");/-$/.test(t.namespace)?n.namespace=t.namespace:n.namespace=t.namespace+"-";break;case"locale":n.locale="auto"===t.locale?null!==(r=null===navigator||void 0===navigator?void 0:navigator.language.slice(0,5))&&void 0!==r?r:"en":t.locale,id.locale=n.locale;break;case"strings":id.merge(t.strings),n.strings=id.strings;break;case"virtualKeyboardLayout":"auto"===t.virtualKeyboardLayout?n.virtualKeyboardLayout=null!==(o={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[id.locale.substring(0,2)])&&void 0!==o?o:"qwerty":n.virtualKeyboardLayout=t.virtualKeyboardLayout;break;case"virtualKeyboardMode":{const e=null===(i=window.matchMedia)||void 0===i?void 0:i.call(window,"(any-pointer: coarse)").matches;"auto"===t.virtualKeyboardMode?n.virtualKeyboardMode=e?"onfocus":"off":n.virtualKeyboardMode=t.virtualKeyboardMode}break;case"letterShapeStyle":"auto"===t.letterShapeStyle?"fr"===id.locale.substring(0,2)?n.letterShapeStyle="french":n.letterShapeStyle="tex":n.letterShapeStyle=t.letterShapeStyle;break;case"plonkSound":bd(n.plonkSound),n.plonkSound=vd(t.plonkSound);break;case"keypressSound":if(bd(n.keypressSound),"string"==typeof t.keypressSound){const e=vd(t.keypressSound);n.keypressSound={delete:e,return:e,spacebar:e,default:e}}else if(t.keypressSound instanceof HTMLAudioElement)n.keypressSound={delete:t.keypressSound,return:t.keypressSound,spacebar:t.keypressSound,default:t.keypressSound};else{if(!t.keypressSound.default)throw Error("Missing keypressSound.default");n.keypressSound={...t.keypressSound},n.keypressSound.return||(n.keypressSound.return=t.keypressSound.default),n.keypressSound.spacebar||(n.keypressSound.spacebar=t.keypressSound.default),n.keypressSound.delete||(n.keypressSound.delete=t.keypressSound.default)}break;case"onBlur":case"onFocus":case"onContentWillChange":case"onContentDidChange":case"onSelectionWillChange":case"onSelectionDidChange":case"onUndoStateWillChange":case"onUndoStateDidChange":case"onModeChange":case"onCommit":case"onVirtualKeyboardToggle":case"onReadAloudStatus":case"onError":if(null===t[e])n[e]=yd;else if("function"!=typeof t[e])throw Error(e+" must be a function or null");n[e]=t[e];break;default:si(t[e])?n[e]=[...t[e]]:"object"==typeof t[e]?n[e]={...t[e]}:n[e]=t[e]}})),void 0!==t.overrideDefaultInlineShortcuts&&(t.overrideDefaultInlineShortcuts?n.inlineShortcuts=t.inlineShortcuts:n.inlineShortcuts={...Xs,...t.inlineShortcuts}),n}function wd(e,t){let n;n="string"==typeof t?[t]:void 0===t?Object.keys(e):t;const r={};return n.forEach((t=>{si(r[t])?r[t]=[...r[t]]:"object"==typeof r[t]?r[t]={...r[t]}:r[t]=e[t]})),"string"==typeof t?r[t]:r}function kd(){return{namespace:"",substituteTextArea:void 0,readOnly:!1,createHTML:e=>e,fontsDirectory:"./fonts",defaultMode:"math",macros:ia,horizontalSpacingScale:1,letterShapeStyle:"auto",smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,ignoreSpacebarInMathMode:!0,locale:id.locale,strings:id.strings,keybindings:jl,overrideDefaultInlineShortcuts:!1,inlineShortcuts:{},inlineShortcutTimeout:0,virtualKeyboardToggleGlyph:'',virtualKeyboardMode:"auto",virtualKeyboards:"all",virtualKeyboardLayout:"auto",customVirtualKeyboardLayers:{},customVirtualKeyboards:{},virtualKeyboardTheme:/android|cros/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?"material":"apple",keypressVibration:!0,keypressSound:null,plonkSound:null,textToSpeechRules:"mathlive",textToSpeechMarkup:"",textToSpeechRulesOptions:{},speechEngine:"local",speechEngineVoice:"Joanna",speechEngineRate:"100%",speakHook:yd,readAloudHook:yd,onAnnounce:gd,onKeystroke:()=>!0,onMoveOutOf:()=>!0,onTabOutOf:()=>!0,onBlur:yd,onFocus:yd,onContentWillChange:yd,onContentDidChange:yd,onSelectionWillChange:yd,onSelectionDidChange:yd,onUndoStateWillChange:yd,onUndoStateDidChange:yd,onModeChange:yd,onVirtualKeyboardToggle:yd,onReadAloudStatus:yd,onCommit:yd,onError:()=>{}}}function _d(e,t,n){"function"==typeof t&&(n=t,t=1/0),void 0===t&&(t=1/0);let r=0,o=!1;for(;!o;){const i=e.model.sibling(r);o=0===t||!i||"math"!==i.mode||!(/mord|textord|mpunct/.test(i.type)||"mop"===i.type&&/[a-zA-Z]+/.test(i.body))||Boolean(i.superscript)||Boolean(i.subscript)||n&&!n(i),o||(i.applyStyle({mode:"text"}),i.symbol=i.body,i.latex=""),r-=1,t-=1}rl(e.model)}function Md(e,t,n){"function"==typeof t&&(n=t,t=1/0),void 0===t&&(t=1/0);let r=0,o=!1;for(;!o;){const i=e.model.sibling(r);o=0===t||!i||"text"!==i.mode||" "===i.body||n&&!n(i),o||i.applyStyle({mode:"math"}),r-=1,t-=1}Sd(e),rl(e.model)}function Sd(e){let t=0;for(;e.model.sibling(t)&&"math"===e.model.sibling(t).mode;)t-=1;if(e.model.sibling(t)&&"text"===e.model.sibling(t).mode&&" "===e.model.sibling(t).body&&(!e.model.sibling(t-1)||"math"===e.model.sibling(t-1).mode)){e.model.siblings().splice(t-1,1),rl(e.model);const n=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0,pl(e.model,e.model.anchorOffset()-1),e.model.suppressChangeNotifications=n}}function Ed(e,t,n){!function(e){const t=e.shiftKey&&e.altKey?3:e.altKey?2:e.shiftKey?1:0;if("Unidentified"===e.key)return;if("Dead"===e.key)return;const n=Dl.filter((n=>{var r;return(null===(r=n.mapping[e.code])||void 0===r?void 0:r[t])===e.key}));0!==n.length&&(n.forEach((e=>{e.score+=1})),Dl.sort(((e,t)=>t.score-e.score)))}(n);const r=Bl();if(e.keyboardLayout!==r.id&&(e.keyboardLayout=r.id,e.keybindings=Hl(e.options.keybindings,(t=>{"function"==typeof e.options.onError&&e.options.onError({code:"invalid-keybinding",arg:t.join("\n")}),console.log(t.join("\n"))}))),function(e,t){const n=e.keystrokeCaption;if(n&&e.keystrokeCaptionVisible){const r=e.element.getBoundingClientRect();n.style.left=r.left+"px",n.style.top=r.top-64+"px",n.innerHTML=e.options.createHTML(""+(Fl(t)||t)+""+n.innerHTML),n.style.visibility="visible",setTimeout((function(){n.childNodes.length>0&&n.removeChild(n.childNodes[n.childNodes.length-1]),0===n.childNodes.length&&(n.style.visibility="hidden")}),3e3)}}(e,t),clearTimeout(e.keystrokeBufferResetTimer),e.options.onKeystroke&&!e.options.onKeystroke(e,t,n))return(null==n?void 0:n.preventDefault)&&(n.preventDefault(),n.stopPropagation()),!1;let o,i,a,s=!1;if("command"!==e.mode&&(!n||!n.ctrlKey&&!n.metaKey))if("[Backspace]"===t)e.keystrokeBuffer=e.keystrokeBuffer.slice(0,-1),e.keystrokeBufferStates.pop(),e.resetKeystrokeBuffer({defer:!0});else if(Yc(n)){const t=ed(n),r=e.keystrokeBuffer+t;let a=0;for(;!o&&a{e.startsWith(i)&&!n.includes(e)&&n.push(e)}));const a=(null==t?void 0:t.inlineShortcuts)?t.inlineShortcuts:null;a&&Object.keys(a).forEach((e=>{e.startsWith(i)&&n.push(e)}))}return n}(r,e.options).length<=1?s=!0:e.resetKeystrokeBuffer({defer:!0})}else e.resetKeystrokeBuffer();if(e.options.smartMode){const r=e.mode;o?e.mode="math":function(e,t,n){if(e.smartModeSuppressed)return!1;if(e.model.endOffset()<*|]$/.test(r))return Sd(e),!0}else{if("[Space]"===t)return _d(e,void 0,(e=>/[a-z][:,;.]$/.test(e.body))),!0;if(/[a-zA-Z]{3,}$/.test(o)&&!/(dxd|abc|xyz|uvw)$/.test(o))return _d(e,void 0,(e=>/[a-zA-Z]/.test(e.body))),!0;if(/(^|\W)(if|If)$/i.test(o))return _d(e,1),!0;if(/(\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5){3,}$/u.test(o)&&!/(αβγ)$/.test(o))return _d(e,void 0,(e=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)/u.test(e.body))),!0;if("?"===r)return!0;if("."===r&&!/[0-9-+]\.$/.test(o))return!0}return!1}(e,t,n)&&(e.mode={math:"text",text:"math"}[e.mode],a=""),e.mode!==r&&"function"==typeof e.options.onModeChange&&e.options.onModeChange(e,e.mode)}if(o||a||(a=function(e,t,n){if(0===e.length)return"";for(let r=e.length-1;r>=0;r--)if(e[r].key===n&&(!e[r].ifMode||e[r].ifMode===t))return e[r].command;return""}(e.keybindings,e.mode,t)),!(o||a||"[Enter]"!==t&&"[Return]"!==t)&&"function"==typeof e.options.onCommit)return e.options.onCommit(e),(null==n?void 0:n.preventDefault)&&(n.preventDefault(),n.stopPropagation()),!1;if(!o&&!a)return!0;if(e.options.readOnly&&"insert"===a[0])return!0;ic(e.model,!1);const l=e.model.parent();if("moveAfterParent"===a&&l&&"leftright"===l.type&&e.model.endOffset()===e.model.siblings().length-1&&e.options.smartFence&&Fc(e.model,".",e.style)&&(a="",Ec(e)),"math"===e.mode&&"[Spacebar]"===t&&!o){const t=e.model.sibling(1),n=e.model.sibling(-1);(t&&"text"===t.mode||n&&"text"===n.mode)&&$c(e.model," ",{mode:"text"})}if(a)e.executeCommand(a);else if(o){e.keyboardDelegate.cancelComposition();const t={...sl(e.model),...e.style};if(!/^(\\{|\\}|\\[|\\]|\\@|\\#|\\$|\\%|\\^|\\_|\\backslash)$/.test(o)){const r=e.mode;$c(e.model,ed(n),{suppressChangeNotifications:!0,mode:e.mode,style:t}),e.snapshotAndCoalesce(),e.restoreToUndoRecord(e.keystrokeBufferStates[i]),e.mode=r}const r=e.model.suppressChangeNotifications;e.model.suppressChangeNotifications=!0,$c(e.model,o,{format:"latex",mode:e.mode,style:t,smartFence:!0}),Sd(e),o.endsWith(" ")&&(e.mode="text",$c(e.model," ",{mode:"text",style:t})),e.model.suppressChangeNotifications=r,rl(e.model),nl(e.model),e.snapshot(),e.dirty=!0,e.model.announce("replacement"),s&&e.resetKeystrokeBuffer()}return e.scrollIntoView(),(null==n?void 0:n.preventDefault)&&(n.preventDefault(),n.stopPropagation()),!1}function zd(e,t,n){if(e.options.readOnly)return void e.model.announce("plonk");if((n=null!=n?n:{}).focus&&e.focus(),n.feedback&&(e.options.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),e.keypressSound&&(e.keypressSound.load(),e.keypressSound.play().catch((e=>console.warn(e))))),n.commandMode&&"command"!==e.mode&&e.switchMode("command"),ic(e.model,!1),n.simulateKeystroke){const n=t.charAt(0);if(!Ed(e,n,new KeyboardEvent("keypress",{key:n})))return}let r="",o=!1;const i={...sl(e.model),...e.style},a=is(t);for(const t of a)if("command"===e.mode){Ls(e.model),e.suggestionIndex=0;const n=oc(e.model),i=_a(n+t);o=i.length>1,0===i.length?($c(e.model,t,{mode:"command"}),/^\\[a-zA-Z\\*]+$/.test(n+t)&&ic(e.model,!0),rc(e)):($c(e.model,t,{mode:"command"}),i[0].match!==n+t&&sd(e.model,i[0].match,-i[0].match.length+n.length+1),r=i[0].match)}else if("math"===e.mode){const n={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[t];if(n){if("moveToSuperscript"===n){if(Cd(e)>=e.options.scriptDepth[1])return void e.model.announce("plonk")}else if("moveToSubscript"===n&&Ld(e)>=e.options.scriptDepth[0])return void e.model.announce("plonk");e.executeCommand(n)}else e.options.smartSuperscript&&"superscript"===e.model.relation()&&/[0-9]/.test(t)&&0===e.model.siblings().filter((e=>"first"!==e.type)).length?($c(e.model,t,{mode:"math",style:i}),El(e.model)):$c(e.model,t,{mode:"math",style:i,smartFence:e.options.smartFence})}else"text"===e.mode&&$c(e.model,t,{mode:"text",style:i});"command"!==e.mode&&e.snapshotAndCoalesce(),e.dirty=!0,e.scrollIntoView(),ec(e,r,o)}function Cd(e){let t=0,n=0,r=e.model.ancestor(n),o=!1;for(;r;)(r.superscript||r.subscript)&&(t+=1),r.superscript?o=!0:r.subscript&&(o=!1),n+=1,r=e.model.ancestor(n);return o?t:0}function Ld(e){let t=0,n=0,r=e.model.ancestor(n),o=!1;for(;r;)(r.superscript||r.subscript)&&(t+=1),r.superscript?o=!1:r.subscript&&(o=!0),n+=1,r=e.model.ancestor(n);return o?t:0}let Od;Lc({undo:e=>(ld(e),e.undo(),!0),redo:e=>(ld(e),e.redo(),!0),scrollIntoView:e=>(e.scrollIntoView(),!0),scrollToStart:e=>(e.field.scroll(0,0),!0),scrollToEnd:e=>{const t=e.field.getBoundingClientRect();return e.field.scroll(t.left-window.scrollX,0),!0},enterCommandMode:e=>(e.switchMode("command"),!0),toggleKeystrokeCaption:e=>(e.keystrokeCaptionVisible=!e.keystrokeCaptionVisible,e.keystrokeCaption.innerHTML="",e.keystrokeCaptionVisible||(e.keystrokeCaption.style.visibility="hidden"),!1),switchMode:(e,t)=>(e.switchMode(t),!0),insert:(e,t,n)=>e.insert(t,n),typedText:(e,t)=>(zd(e,t),!0),commit:e=>("function"==typeof e.options.onCommit&&e.options.onCommit(e),!0)}),Lc({applyStyle:function(e,t){e.resetKeystrokeBuffer();const n=function(e){const t={};return"string"==typeof e.mode&&(t.mode=e.mode.toLowerCase(),console.assert("math"===t.mode||"text"===t.mode||"command"===t.mode)),"string"==typeof e.color&&(t.color=e.color),"string"==typeof e.backgroundColor&&(t.backgroundColor=e.backgroundColor),"string"==typeof e.fontFamily&&(t.fontFamily=e.fontFamily),"string"==typeof e.series&&(t.fontSeries=e.series),"string"==typeof e.fontSeries&&(t.fontSeries=e.fontSeries.toLowerCase()),t.fontSeries&&(t.fontSeries={bold:"b",medium:"m",normal:"m"}[t.fontSeries]||t.fontSeries),"string"==typeof e.shape&&(t.fontShape=e.shape),"string"==typeof e.fontShape&&(t.fontShape=e.fontShape.toLowerCase()),t.fontShape&&(t.fontShape={italic:"it",up:"n",upright:"n",normal:"n"}[t.fontShape]||t.fontShape),"string"==typeof e.size?t.fontSize=e.size:"number"==typeof e.size&&(t.fontSize="size"+Math.min(0,Math.max(10,e.size))),"string"==typeof e.fontSize&&(t.fontSize=e.fontSize.toLowerCase()),t.fontSize&&(t.fontSize={tiny:"size1",scriptsize:"size2",footnotesize:"size3",small:"size4",normal:"size5",normalsize:"size5",large:"size6",Large:"size7",LARGE:"size8",huge:"size9",Huge:"size10"}[t.fontSize]||t.fontSize),t}(t);if(n.mode){if(kl(e.model))e.switchMode(n.mode);else{const t=e.mode,n="math"===(dl(e.model)||e.options.defaultMode)?"text":"math";let r=e.getValue(e.selection,"ASCIIMath");if("math"===n&&/^"[^"]+"$/.test(r)&&(r=r.slice(1,-1)),e.insert(r,{mode:n,selectionMode:"item",format:"text"===n?"text":"ASCIIMath"}),e.mode=n,e.model.groupIsSelected()){const t=e.model.parent();!t||"group"!==t.type&&"root"!==t.type||(t.mode=n)}e.mode!==t&&"function"==typeof e.options.onModeChange&&e.options.onModeChange(e,e.mode)}delete n.mode}return kl(e.model)?(e.style.fontSeries&&n.fontSeries===e.style.fontSeries&&(n.fontSeries="auto"),n.fontShape&&n.fontShape===e.style.fontShape&&(n.fontShape="auto"),n.color&&n.color===e.style.color&&(n.color="none"),n.backgroundColor&&n.backgroundColor===e.style.backgroundColor&&(n.backgroundColor="none"),n.fontSize&&n.fontSize===e.style.fontSize&&(n.fontSize="auto"),e.style={...e.style,...n}):(Bc(e.model,n),e.snapshot()),!0}},{target:"mathfield"}),Lc({copyToClipboard:e=>(e.focus(),kl(e.model)&&e.select(),document.execCommand("copy"),!1),cutToClipboard:e=>(e.focus(),document.execCommand("cut"),!0),pasteFromClipboard:e=>(e.focus(),document.execCommand("paste"),!0)},{target:"mathfield",category:"clipboard"});let Td=0;function Ad(e,t,n){let r={element:null,distance:Number.POSITIVE_INFINITY},o=!0;if(e.getAttribute("data-atom-id")){r.element=e;const i=e.getBoundingClientRect(),a=t-(i.left+i.right)/2,s=n-(i.top+i.bottom)/2;r.distance=a*a+s*s,o=t>=i.left&&t<=i.right}if(o&&e.children)for(const o of e.children){const e=Ad(o,t,n);e.element&&e.distance<=r.distance&&(r=e)}return r}function Dd(e,t,n,r){var o;(r=null!=r?r:{}).bias=null!==(o=r.bias)&&void 0!==o?o:0;const i=Ad(e.field,t,n).element,a=i?i.getAttribute("data-atom-id"):null;if(!a)return;const s=Ol(e.model,(e=>{if(!e.captureSelection)return e.id===a;let t=!1;return e.forEach((e=>{e.id===a&&(t=!0)})),t}));if(!s||0===s.length)return;const l=Ds(s[0]).path;if(0===r.bias){const e=i.getBoundingClientRect();tf ()",classes:"tex",layers:["functions"]},symbols:{tooltip:"keyboard.tooltip.symbols",layer:"symbols",label:"∞≠∈",classes:"tex",layers:["symbols"]},command:{tooltip:"keyboard.tooltip.command",command:"enterCommandMode",label:"",layers:["lower-command","upper-command","symbols-command"]},style:{tooltip:"keyboard.tooltip.style",layer:"style",label:"bi𝔹"}},Nd={"\\varphi ":["Φ","\\Phi "],"\\varsigma ":["Σ","\\Sigma "],"\\epsilon ":["Ɛ",'{\\char"0190}'],"\\rho ":["Ρ",'{\\char"3A1}'],"\\tau ":["Τ",'{\\char"3A4}'],"\\upsilon ":["Υ","\\Upsilon "],"\\theta ":["Θ","\\Theta "],"\\iota ":["Ι",'{\\char"399}'],"\\omicron ":["Ο",'{\\char"39F}'],"\\pi ":["Π","\\Pi "],"\\alpha ":["Α",'{\\char"391}'],"\\sigma ":["Σ","\\Sigma "],"\\delta ":["Δ","\\Delta "],"\\phi ":["Φ","\\Phi "],"\\gamma ":["Γ","\\Gamma "],"\\eta ":["Η",'{\\char"397}'],"\\xi ":["Ξ","\\Xi "],"\\kappa ":["Κ",'{\\char"39A}'],"\\lambda ":["Λ","\\Lambda "],"\\zeta ":["Ζ",'{\\char"396}'],"\\chi ":["Χ",'{\\char"3A7}'],"\\psi ":["Ψ","\\Psi "],"\\omega ":["Ω","\\Omega "],"\\beta ":["Β",'{\\char"392}'],"\\nu ":["Ν",'{\\char"39D}'],"\\mu ":["Μ",'{\\char"39C}']},Rd={0:["\\emptyset","\\varnothing","\\infty",{latex:"#?_0",insert:"#@_0"},"\\circ","\\bigcirc","\\bullet"],2:["\\frac{1}{2}",{latex:"#?^2",insert:"#@^2"}],3:["\\frac{1}{3}",{latex:"#?^3",insert:"#@^3"}],".":[",",";","\\colon",{latex:":",aside:"ratio"},{latex:"\\cdotp",aside:"center dot",classes:"box"},{latex:"\\cdots",aside:"center ellipsis",classes:"box"},{latex:"\\ldotp",aside:"low dot",classes:"box"},{latex:"\\ldots",aside:"low ellipsis",classes:"box"},{latex:"\\vdots",aside:"",classes:"box"},{latex:"\\ddots",aside:"",classes:"box"},"\\odot","\\oslash","\\circledcirc"],"*":["\\cdot","\\ast","\\star","\\bigstar","\\ltimes","\\rtimes","\\rightthreetimes","\\leftthreetimes","\\intercal","\\prod",{latex:"\\prod_{n\\mathop=0}^{\\infty}",classes:"small"}],"+":["\\pm","\\mp","\\sum",{latex:"\\sum_{n\\mathop=0}^{\\infty}",classes:"small"},"\\dotplus","\\oplus"],"-":["\\pm","\\mp","\\ominus","\\vert #0 \\vert"],"/":["\\divideontimes","/","\\div"],"(":["\\left( #0\\right)","\\left[ #0\\right]","\\left\\{ #0\\right\\}","\\left\\langle #0\\right\\rangle","\\lfloor","\\llcorner","(","\\lbrack","\\lvert","\\lVert","\\lgroup","\\langle","\\lceil","\\ulcorner","\\lmoustache","\\lbrace"],")":["\\rfloor","\\lrcorner",")","\\rbrack","\\rvert","\\rVert","\\rgroup","\\rangle","\\rceil","\\urcorner","\\rmoustache","\\rbrace"],"=":["\\cong","\\asymp","\\equiv","\\differencedelta","\\varpropto","\\thickapprox","\\approxeq","\\thicksim","\\backsim","\\eqsim","\\simeq","\\Bumpeq","\\bumpeq","\\doteq","\\Doteq","\\fallingdotseq","\\risingdotseq","\\coloneq","\\eqcirc","\\circeq","\\triangleq","\\between"],"!=":["\\neq","\\ncong","","\\nsim"],"<":["\\leq","\\leqq","\\lneqq","\\ll","\\nless","\\nleq","\\precsim","\\lesssim","\\lessgtr","\\prec","\\preccurlyeq","\\lessdot","\\nprec"],">":["\\geq","\\geqq","\\gneqq","\\gg","\\ngtr","\\ngeq","\\succsim","\\gtrsim","\\gtrless","\\succ","\\succcurlyeq","\\gtrdot","\\nsucc"],set:["\\in","\\owns","\\subset","\\nsubset","\\supset","\\nsupset"],"!set":["\\notin","\\backepsilon"],subset:[],supset:[],infinity:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"],"numeric-pi":["\\prod","\\theta","\\rho","\\sin","\\cos","\\tan"],ee:["\\times 10^{#?}","\\ln","\\ln_{10}","\\log"],"^":["_{#?}"],int:[{latex:"\\int_{#?}^{#?}",classes:"small"},{latex:"\\int",classes:"small"},{latex:"\\smallint",classes:"small"},{latex:"\\iint",classes:"small"},{latex:"\\iiint",classes:"small"},{latex:"\\oint",classes:"small"},{latex:"\\dfrac{\\rd}{\\rd x}",classes:"small"},{latex:"\\frac{\\partial}{\\partial x}",classes:"small"},"\\capitalDifferentialD","\\rd","\\partial"],nabla:["\\nabla\\times","\\nabla\\cdot","\\nabla^{2}"],"!":["!!","\\Gamma","\\Pi"],accents:["\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"],A:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"}],b:[{latex:"\\beth",aside:"beth"}],B:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"}],d:[{latex:"\\daleth",aside:"daleth"}],D:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"}],g:[{latex:"\\gimel",aside:"gimel"}],G:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"}],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\N",aside:"set of natural numbers"}],p:[{latex:"\\P",aside:"set of primes"}],q:[{latex:"\\Q",aside:"set of rational numbers"}],r:[{latex:"\\R",aside:"set of real numbers"}],z:[{latex:"\\Z",aside:"set of integers"}],"x-var":["y","z","t","r",{latex:"f(#?)",classes:"small"},{latex:"g(#?)",classes:"small"},"x^2","x^n","x_n","x_{n+1}","x_i","x_{i+1}"],"n-var":["i","j","p","k","a","u"],ii:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"],logic:[{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn’t"},{latex:"\\ni",aside:"such that"},{latex:"\\Colon",aside:"such that"},{latex:"\\implies",aside:"implies"},{latex:"\\impliedby",aside:"implied by"},{latex:"\\iff",aside:"if and only if"},{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"},{latex:"\\therefore",aside:"therefore"},{latex:"\\because",aside:"because"},{latex:"^\\biconditional",aside:"biconditional"},"\\leftrightarrow","\\Leftrightarrow","\\to","\\models","\\vdash","\\gets","\\dashv","\\roundimplies"],"set-operators":["\\cap","\\cup","\\setminus","\\smallsetminus","\\complement"],"set-relations":["\\in","\\notin","\\ni","\\owns","\\subset","\\supset","\\subseteq","\\supseteq","\\subsetneq","\\supsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space
⁻³⧸₁₈ em"},{latex:'\\unicode{"203A}\\,\\unicode{"2039}',insert:"\\,",aside:"thin space
³⧸₁₈ em"},{latex:'\\unicode{"203A}\\:\\unicode{"2039}',insert:"\\:",aside:"medium space
⁴⧸₁₈ em"},{latex:'\\unicode{"203A}\\;\\unicode{"2039}',insert:"\\;",aside:"thick space
⁵⧸₁₈ em"},{latex:'\\unicode{"203A}\\ \\unicode{"2039}',insert:"\\ ",aside:"⅓ em"},{latex:'\\unicode{"203A}\\enspace\\unicode{"2039}',insert:"\\enspace",aside:"½ em"},{latex:'\\unicode{"203A}\\quad\\unicode{"2039}',insert:"\\quad",aside:"1 em"},{latex:'\\unicode{"203A}\\qquad\\unicode{"2039}',insert:"\\qquad",aside:"2 em"}],delete:[{label:'',command:'"deleteAll"'}],"->|":[]};let Bd={};const jd={math:"\n
\n
    \n
  • x
  • \n
  • n
  • \n
  • \n \n
  • \n
  • e
  • \n
  • i
  • \n
  • \n
\n
    \n
  • <
  • \n
  • >
  • \n
  • \n \n
  • \n
  • x ²
  • \n
  • x
  • \n
  • \n
\n
    \n
  • (
  • \n
  • )
  • \n
  • \n \n
  • \n
  • \n
  • \n
\n \n
    \n
  • \n
  • \n
  • \n \n
  • \n \n
\n
\n ","lower-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ;
  • \n
  • ,
  • \n
  •  
  • \n \n
\n
","upper-roman":"\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n
  • ;
  • \n
  • ;
  • \n
  •  
  • \n \n
\n
",symbols:"\n
\n
    \n \n
  • {
  • \n
  • }
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • [
  • \n
  • ]
  • \n
  • \n
  • \n
  • \n
  • !
  • \n
  • o
  • \n
  • o
  • \n
  • \n
  • \n\n
\n
    \n \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n\n
  • \n
\n
    \n \n
  • ,
  • \n
  • \n
  • :
  • \n
  • \n
  • \n
  • \n
  • ±
  • \n \n
\n
","lower-greek":"\n
\n
  • φ
  • \n
  • ς
  • \n
  • ϵ
  • \n
  • ρ
  • \n
  • τ
  • \n
  • υ
  • \n
  • θ
  • \n
  • ι
  • \n
  • ο
  • \n
  • π
  • \n
\n
  • α
  • \n
  • σ
  • \n
  • δ
  • \n
  • ϕ
  • \n
  • γ
  • \n
  • η
  • \n
  • ξ
  • \n
  • κ
  • \n
  • λ
  • \n
\n
  • \n
  • ζ
  • \n
  • χ
  • \n
  • ψ
  • \n
  • ω
  • \n
  • β
  • \n
  • ν
  • \n
  • μ
  • \n
  • \n
\n
    \n
  •  
  • \n
  • ,
  • \n
  • ε
  • \n
  • ϑ
  • \n
  • ϰ
  • \n
  • ϖ
  • \n
  • ϱ
  • \n \n
\n
","upper-greek":"\n
\n
  • Φ
  • \n
  • Σ
  • \n
  • Ɛ
  • \n
  • Ρ
  • \n
  • Τ
  • \n
  • Υ
  • \n
  • Θ
  • \n
  • Ι
  • \n
  • Ο
  • \n
  • Π
\n
  • Α
  • \n
  • Σ
  • \n
  • Δ
  • \n
  • Φ
  • \n
  • Γ
  • \n
  • Η
  • \n
  • Ξ
  • \n
  • Κ
  • \n
  • Λ
\n
  • \n
  • Ζ
  • \n
  • Χ
  • \n
  • Ψ
  • \n
  • Ω
  • \n
  • Β
  • \n
  • Ν
  • \n
  • Μ
  • \n
\n
    \n
  •  
  • \n
  • .
  • \n
  •  
  • \n \n
\n
","lower-command":"\n
\n
\n
\n
\n
    \n
  • 01#
  • \n
  • {
  • \n
  • }
  • \n
  • ^
  • \n
  • _
  • \n
  •  
  • \n \n
\n
","upper-command":"\n
\n
\n
\n
\n
    \n
  • \n
  • [
  • \n
  • ]
  • \n
  • (
  • \n
  • )
  • \n
  •  
  • \n \n
\n
","symbols-command":"\n
\n
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 0
\n
  • !
  • @
  • #
  • $
  • %
  • ^
  • &
  • *
  • +
  • =
\n
    \n
  • \\
  • \n
  • |
  • \n
  • /
  • \n
  • `
  • \n
  • ;
  • \n
  • :
  • \n
  • ?
  • \n
  • '
  • \n
  • \"
  • \n
  • \n
\n
    \n
  • abc
  • \n
  • <
  • \n
  • >
  • \n
  • ~
  • \n
  • ,
  • \n
  • .
  • \n
  •  
  • \n \n
\n
",functions:"\n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
  • \n
  • (
  • \n
  • )
  • \n
  • \n
  • \n
  •  
  • \n \n
\n
",style:"\n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
\n
    \n
  • \n
  • \n
  • \n\n
  • \n
  • \n
  • \n
  • \n
\n
"};function $d(e,t,n){return e=e.replace(/(^|[^\\])#@/g,"$1#?"),Xi(Zi(ms({mathstyle:Li.displaystyle,macros:n.options.macros},_s(e,"math",t,n.options.macros)),"ML__base"),"ML__mathlive").toMarkup()}function Kd(e,t,n){var r;let o="
";const i=t.replace(/\s+/g," ").split(" ");if(i.length>1){const t={...Id,...null!==(r=e.options.customVirtualKeyboards)&&void 0!==r?r:{}};for(const e of i){if(!t[e]){console.error('Unknown virtual keyboard "'+e+'"');break}o+="
"+t[e].label+"
"}}return o+="
",o+=`\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n `,""}function qd(e,t,n){var r;for(let o=0;o"+i.getAttribute("data-aside").replace(/"/g,'"')+""),void 0!==a&&(i.innerHTML=e.options.createHTML(a)),i.getAttribute("data-classes")&&i.classList.add(i.getAttribute("data-classes"));const s=null===(r=i.getAttribute("data-insert"))||void 0===r?void 0:r.replace(/"/g,'"');let l;if(s&&Nd[s]&&(i.setAttribute("data-shifted",Nd[s][0]),i.setAttribute("data-shifted-command",JSON.stringify(["insertAndUnshiftKeyboardLayer",Nd[s][1]]))),l=i.getAttribute("data-command")?JSON.parse(i.getAttribute("data-command")):i.getAttribute("data-insert")?["insert",i.getAttribute("data-insert"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:i.getAttribute("data-latex")?["insert",i.getAttribute("data-latex"),{focus:!0,feedback:!0,mode:"math",format:"latex",resetStyle:!0}]:["typedText",i.getAttribute("data-key")||i.textContent,{focus:!0,feedback:!0,simulateKeystroke:!0}],n&&(l=[n,l]),i.getAttribute("data-alt-keys")){const e=Bd[i.getAttribute("data-alt-keys")];e?l={default:l,pressAndHoldStart:["showAlternateKeys",i.getAttribute("data-alt-keys"),e],pressAndHoldEnd:"hideAlternateKeys"}:console.warn('Unknown alt key set: "'+i.getAttribute("data-alt-keys"))}Jl(e,i,l)}}function Fd(e,t){const n={qwerty:{"lower-1":"qwertyuiop","lower-2":" asdfghjkl ","lower-3":"^zxcvbnm~","upper-1":"QWERTYUIOP","upper-2":" ASDFGHJKL ","upper-3":"^ZXCVBNM~","numpad-1":"789/","numpad-2":"456*","numpad-3":"123-","numpad-4":"0.=+"},azerty:{"lower-1":"azertyuiop","lower-2":"qsdfghjklm","lower-3":"^ wxcvbn ~","upper-1":"AZERTYUIOP","upper-2":"QSDFGHJKLM","upper-3":"^ WXCVBN ~"},qwertz:{"lower-1":"qwertzuiop","lower-2":" asdfghjkl ","lower-3":"^yxcvbnm~","upper-1":"QWERTZUIOP","upper-2":" ASDFGHJKL","upper-3":"^YXCVBNM~"},dvorak:{"lower-1":"^ pyfgcrl ","lower-2":"aoeuidhtns","lower-3":"qjkxbmwvz~","upper-1":"^ PYFGCRL ","upper-2":"AOEUIDHTNS","upper-3":"QJKXBMWVZ~"},colemak:{"lower-1":" qwfpgjluy ","lower-2":"arstdhneio","lower-3":"^zxcvbkm~","upper-1":" QWFPGNLUY ","upper-2":"ARSTDHNEIO","upper-3":"^ZXCVBKM~"}},r=n[e.options.virtualKeyboardLayout]?n[e.options.virtualKeyboardLayout]:n.qwerty;let o,i=t;i=i.replace(//g,"\n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
  • ");let a=i.match(/()/);for(;a;){o="";const e=a[2].match(/[a-zA-Z][a-zA-Z0-9-]*=(['"])(.*?)\1/g),t={};for(const n of e){const e=n.match(/([a-zA-Z][a-zA-Z0-9-]*)=(['"])(.*?)\2/);t[e[1]]=e[3]}let s=r[t.name];if(s||(s=n.qwerty[t.name]),s)for(const e of s){let n=t.class||"";n&&(n=" "+n),"~"===e?(o+="
  • \'\n data-shifted-command=\'"deleteAll"\'\n data-alt-keys=\'delete\' data-command=\'["performWithFeedback","deletePreviousChar"]\'\n >⌫
  • '):" "===e?o+="
  • ":"^"===e?o+="
  • ":"/"===e?o+="
  • ÷
  • ":"*"===e?o+="
  • ×
  • ":"-"===e?o+="
  • ":/tt/.test(n)?o+="
  • '+e+"
  • ":o+="
  • "+e+"
  • "}else console.warn("Unknown roman keyboard row: "+t.name);i=i.replace(new RegExp(a[1]+a[2]+a[3]),o),a=i.match(/()/)}return i}function Hd(){const e=document.getElementById("mathlive-alternate-keys-panel");return e&&(e.classList.remove("is-visible"),e.innerHTML="",Zl(e)),!1}function Wd(e){var t;if(!Gl(e))return!1;Hd();const n=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.element.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(n)for(let t=0;tli{display:flex;flex-flow:column;align-items:center;justify-content:center;font-size:30px;height:70px;width:70px;box-sizing:border-box;margin:0;background:transparent;border:1px solid transparent;border-radius:5px;pointer-events:all;color:var(--keyboard-alternate-text);fill:currentColor}@media only screen and (max-height:412px){.ML__keyboard.alternate-keys ul>li{font-size:24px;height:50px;width:50px}}.ML__keyboard.alternate-keys ul>li.active,.ML__keyboard.alternate-keys ul>li.pressed,.ML__keyboard.alternate-keys ul>li:hover{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);background:var(--keyboard-alternate-background-active);color:var(--keyboard-text-active)}.ML__keyboard.alternate-keys ul>li.small{font-size:18px}.ML__keyboard.alternate-keys ul>li.small-button{width:42px;height:42px;margin:2px;background:#fbfbfb}.ML__keyboard.alternate-keys ul>li.small-button:hover{background:var(--keyboard-alternate-background-active)}.ML__keyboard.alternate-keys ul>li.box>div,.ML__keyboard.alternate-keys ul>li.box>span{border:1px dashed rgba(0,0,0,.24)}.ML__keyboard.alternate-keys ul>li .warning{min-height:60px;min-width:60px;background:#cd0030;color:#fff;padding:5px;display:flex;align-items:center;justify-content:center;border-radius:5px}.ML__keyboard.alternate-keys ul>li .warning.active,.ML__keyboard.alternate-keys ul>li .warning.pressed,.ML__keyboard.alternate-keys ul>li .warning:hover{background:red}.ML__keyboard.alternate-keys ul>li .warning svg{width:50px;height:50px}.ML__keyboard.alternate-keys ul>li aside{font-size:12px;line-height:12px;opacity:.78;padding-top:2px}.ML__keyboard>div.keyboard-layer{display:none;outline:none}.ML__keyboard>div.keyboard-layer.is-visible{display:flex;flex-flow:column}.ML__keyboard>div>div.keyboard-toolbar{align-self:center;display:flex;flex-flow:row;justify-content:space-between;width:736px}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard>div>div.keyboard-toolbar{width:556px}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar{width:365px;max-width:100vw}}.ML__keyboard>div>div.keyboard-toolbar svg{height:20px;width:20px}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar svg{height:13px;width:17px}}.ML__keyboard>div>div.keyboard-toolbar>.left{position:relative;display:flex;justify-content:flex-start;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>.right{display:flex;justify-content:flex-end;flex-flow:row}.ML__keyboard>div>div.keyboard-toolbar>div>div{display:flex;align-items:baseline;justify-content:center;pointer-events:all;color:var(--keyboard-text);fill:currentColor;background:0;font-size:110%;cursor:pointer;min-height:0;padding:4px 10px;margin:7px 4px 6px;box-shadow:none;border:none;border-bottom:2px solid transparent}.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled.pressed svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled:hover svg,.ML__keyboard>div>div.keyboard-toolbar>div>div.disabled svg{color:var(--keyboard-text);opacity:.2}@media only screen and (max-width:414px){.ML__keyboard>div>div.keyboard-toolbar>div>div{font-size:100%;padding:0 6px 0 0}}@media only screen and (max-width:767px){.ML__keyboard>div>div.keyboard-toolbar>div>div{padding-left:4px;padding-right:4px;font-size:90%}}.ML__keyboard>div>div.keyboard-toolbar>div>div.active,.ML__keyboard>div>div.keyboard-toolbar>div>div.pressed,.ML__keyboard>div>div.keyboard-toolbar>div>div:active,.ML__keyboard>div>div.keyboard-toolbar>div>div:hover{color:var(--keyboard-text-active)}.ML__keyboard>div>div.keyboard-toolbar>div>div.selected{color:var(--keyboard-text-active);border-bottom:2px solid var(--keyboard-text-active);margin-bottom:8px;padding-bottom:0}.ML__keyboard div .rows{border:0;border-collapse:separate;clear:both;margin:auto;display:flex;flex-flow:column;align-items:center}.ML__keyboard div .rows>ul{list-style:none;height:40px;margin:0 0 3px;padding:0}.ML__keyboard div .rows>ul>li{display:flex;flex-flow:column;align-items:center;justify-content:center;width:34px;margin-right:2px;height:40px;box-sizing:border-box;padding:8px 0;vertical-align:top;text-align:center;float:left;color:var(--keycap-text);fill:currentColor;font-size:20px;background:var(--keycap-background);border:1px solid var(--keycap-background-border);border-bottom-color:var(--keycap-background-border-bottom);border-radius:5px;pointer-events:all;position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ML__keyboard div .rows>ul>li:last-child{margin-right:0}.ML__keyboard div .rows>ul>li.small{font-size:16px}.ML__keyboard div .rows>ul>li.tt{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.bottom{justify-content:flex-end}.ML__keyboard div .rows>ul>li.left{align-items:flex-start;padding-left:4px}.ML__keyboard div .rows>ul>li.right{align-items:flex-end;padding-right:4px}.ML__keyboard div .rows>ul>li svg{width:20px;height:20px}.ML__keyboard div .rows>ul>li .warning{height:25px;width:25px;min-height:25px;min-width:25px;background:#cd0030;color:#fff;border-radius:100%;padding:5px;display:flex;align-items:center;justify-content:center;margin-bottom:-2px}.ML__keyboard div .rows>ul>li .warning svg{width:16px;height:16px}@media only screen and (max-width:768px){.ML__keyboard div .rows>ul>li .warning{height:16px;width:16px;min-height:16px;min-width:16px}.ML__keyboard div .rows>ul>li .warning svg{width:14px;height:14px}}.ML__keyboard div .rows>ul>li>.w0{width:0}.ML__keyboard div .rows>ul>li>.w5{width:16px}.ML__keyboard div .rows>ul>li>.w15{width:52px}.ML__keyboard div .rows>ul>li>.w20{width:70px}.ML__keyboard div .rows>ul>li>.w50{width:178px}.ML__keyboard div .rows>ul>li.separator{background:transparent;border:none;pointer-events:none}@media only screen and (max-width:560px){.ML__keyboard div .rows>ul>li.if-wide{display:none}}.ML__keyboard div .rows>ul>li.tex-math{font-size:25px}.ML__keyboard div .rows>ul>li.pressed,.ML__keyboard div .rows>ul>li:hover{background:var(--keycap-background-active);color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.active,.ML__keyboard div .rows>ul>li.action:active,.ML__keyboard div .rows>ul>li.keycap.active,.ML__keyboard div .rows>ul>li.keycap:active{transform:translateY(-20px) scale(1.4);z-index:calc(var(--keyboard-zindex, 105) - 5);color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.modifier.active,.ML__keyboard div .rows>ul>li.modifier:active{background:var(--keyboard-text-active);color:var(--keycap-text-active)}.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:18px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.action.font-glyph,.ML__keyboard div .rows>ul>li.modifier.font-glyph{font-size:16px}}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton,.ML__keyboard div .rows>ul>li.fnbutton{font-size:12px}}.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:14px}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li.bigfnbutton{font-size:9px}}.ML__keyboard div .rows>ul>li.action,.ML__keyboard div .rows>ul>li.modifier{background-color:var(--keycap-modifier-background);border-bottom-color:var(--keycap-modifier-border);border-color:var(--keycap-modifier-border) var(--keycap-modifier-border) var(--keycap-modifier-border-bottom);font-size:65%;font-weight:100}.ML__keyboard div .rows>ul>li.action.selected,.ML__keyboard div .rows>ul>li.modifier.selected{color:var(--keyboard-text-active)}.ML__keyboard div .rows>ul>li.action.selected.active,.ML__keyboard div .rows>ul>li.action.selected.pressed,.ML__keyboard div .rows>ul>li.action.selected:active,.ML__keyboard div .rows>ul>li.action.selected:hover,.ML__keyboard div .rows>ul>li.modifier.selected.active,.ML__keyboard div .rows>ul>li.modifier.selected.pressed,.ML__keyboard div .rows>ul>li.modifier.selected:active,.ML__keyboard div .rows>ul>li.modifier.selected:hover{color:#fff}.ML__keyboard div .rows>ul>li.keycap.w50{font-size:80%;padding-top:10px;font-weight:100}.ML__keyboard div .rows>ul>li small{color:#555}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li small{font-size:9px}}.ML__keyboard div .rows>ul>li aside{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:10px;line-height:10px;color:#666}@media only screen and (max-width:767px){.ML__keyboard div .rows>ul>li aside{display:none}}@media only screen and (max-width:414px){.ML__keyboard div .rows>ul>li{width:calc(10vw - 2px);margin-right:2px}.ML__keyboard div .rows>ul>.w5{width:calc(5vw - 2px)}.ML__keyboard div .rows>ul>.w15{width:calc(15vw - 2px)}.ML__keyboard div .rows>ul>.w20{width:calc(20vw - 2px)}.ML__keyboard div .rows>ul>.w50{width:calc(50vw - 2px)}}@media only screen and (min-width:415px) and (max-width:768px){.ML__keyboard div .rows>ul>li{width:37px;margin-right:3px}.ML__keyboard div .rows>ul>.w5{width:17px}.ML__keyboard div .rows>ul>.w15{width:57px}.ML__keyboard div .rows>ul>.w20{width:77px}.ML__keyboard div .rows>ul>.w50{width:197px}}@media only screen and (min-width:768px) and (max-width:1024px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:51px;margin-right:4px}.ML__keyboard div .rows>ul>.w5{width:23.5px}.ML__keyboard div .rows>ul>.w15{width:78.5px}.ML__keyboard div .rows>ul>.w20{width:106px}.ML__keyboard div .rows>ul>.w50{width:271px}}@media only screen and (min-width:1025px){.ML__keyboard div .rows>ul{height:52px}.ML__keyboard div .rows>ul>li{height:52px;width:66px;margin-right:6px}.ML__keyboard div .rows>ul>.action,.ML__keyboard div .rows>ul>.modifier{font-size:80%}.ML__keyboard div .rows>ul>.w5{width:30px}.ML__keyboard div .rows>ul>.w15{width:102px}.ML__keyboard div .rows>ul>.w20{width:138px}.ML__keyboard div .rows>ul>.w50{width:354px}}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue,212),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue,212),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue,212),25%,39%);--keycap-background-active:hsl(var(--hue,212),35%,42%);--keycap-background-border:hsl(var(--hue,212),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue,212),35%,40%);--keycap-modifier-border:hsl(var(--hue,212),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue,212),35%,42%);--keyboard-alternate-background:hsl(var(--hue,212),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue,212),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] .ML__keyboard{--hue:206;--keyboard-background:hsl(var(--hue,212),19%,38%);--keyboard-text:#f0f0f0;--keyboard-text-active:hsl(var(--hue,212),100%,60%);--keyboard-background-border:#333;--keycap-background:hsl(var(--hue,212),25%,39%);--keycap-background-active:hsl(var(--hue,212),35%,42%);--keycap-background-border:hsl(var(--hue,212),25%,35%);--keycap-background-border-bottom:#426b8a;--keycap-text:#d0d0d0;--keycap-text-active:#000;--keycap-secondary-text:#fff;--keycap-modifier-background:hsl(var(--hue,212),35%,40%);--keycap-modifier-border:hsl(var(--hue,212),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue,212),35%,42%);--keyboard-alternate-background:hsl(var(--hue,212),19%,38%);--keyboard-alternate-background-active:hsl(var(--hue,212),35%,42%);--keyboard-alternate-text:#d1d1d1}div.ML__keyboard.material{--keyboard-background:rgba(209,213,217,0.9);--keyboard-background-border:#ddd;--keycap-background:transparent;--keycap-background-active:#cccfd1;--keycap-background-border:transparent;--keyboard-alternate-background:#efefef;--keyboard-alternate-text:#000;font-family:Roboto,sans-serif}div.ML__keyboard.material.alternate-keys{background:var(--keyboard-alternate-background);border:1px solid transparent;border-radius:5px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}div.ML__keyboard.material.alternate-keys ul li.active,div.ML__keyboard.material.alternate-keys ul li.pressed,div.ML__keyboard.material.alternate-keys ul li:active,div.ML__keyboard.material.alternate-keys ul li:hover{border:1px solid transparent;background:#5f97fc;color:#fff;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>div{font-size:16px}div.ML__keyboard.material .keyboard-toolbar div.div.active,div.ML__keyboard.material .keyboard-toolbar div.div.pressed,div.ML__keyboard.material .keyboard-toolbar div div:active,div.ML__keyboard.material .keyboard-toolbar div div:hover{color:#5f97fc;fill:currentColor}div.ML__keyboard.material .keyboard-toolbar>div>.selected{color:#5f97fc;fill:currentColor;border-bottom:2px solid #5f97fc;margin-bottom:8px;padding-bottom:0}div.ML__keyboard.material div>.rows>ul>.keycap{background:transparent;border:1px solid transparent;border-radius:5px;color:var(--keycap-text);fill:currentColor;transition:none}div.ML__keyboard.material div>.rows>ul>.keycap.tt{color:#5f97fc}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]{margin-top:10px;margin-bottom:10px;height:20px;background:#e0e0e0}div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "].pressed,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:active,div.ML__keyboard.material div>.rows>ul>.keycap[data-key=" "]:hover{background:#d0d0d0;box-shadow:none;transform:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):hover{border:1px solid transparent;background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{background:var(--keyboard-alternate-background);color:var(--keyboard-alternate-text);box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23);font-size:10px;vertical-align:top;width:19.5px;margin-right:10px;margin-left:10px;transform:translateY(-20px) scale(2);transition:none;justify-content:flex-start;padding:2px 0 0;z-index:calc(var(--ML_keyboard-zindex, 105) - 5)}}@media only screen and (max-width:414px){div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).active,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]).pressed,div.ML__keyboard.material div>.rows>ul>.keycap:not([data-key=" "]):active{width:16.5px}}@media only screen and (max-width:767px){div.ML__keyboard.material div>.rows>ul>.keycap:last-child.active,div.ML__keyboard.material div>.rows>ul>.keycap:last-child:active{margin-right:0;margin-left:14px}}div.ML__keyboard.material div div.rows ul li.action,div.ML__keyboard.material div div.rows ul li.modifier{background:transparent;border:0;color:#869096;fill:currentColor;font-size:16px;transition:none}div.ML__keyboard.material div div.rows ul li.action.selected,div.ML__keyboard.material div div.rows ul li.modifier.selected{color:#5f97fc;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.action.active,div.ML__keyboard.material div div.rows ul li.action.pressed,div.ML__keyboard.material div div.rows ul li.action:active,div.ML__keyboard.material div div.rows ul li.action:hover,div.ML__keyboard.material div div.rows ul li.modifier.active,div.ML__keyboard.material div div.rows ul li.modifier.pressed,div.ML__keyboard.material div div.rows ul li.modifier:active,div.ML__keyboard.material div div.rows ul li.modifier:hover{border:0;color:var(--keycap-text);background:var(--keycap-background-active);box-shadow:none}div.ML__keyboard.material div div.rows ul li.bigfnbutton,div.ML__keyboard.material div div.rows ul li.fnbutton{background:transparent;border:0}div.ML__keyboard.material div div.rows ul li.bigfnbutton.selected,div.ML__keyboard.material div div.rows ul li.fnbutton.selected{color:#5f97fc;fill:currentColor;border-radius:0;border-bottom:2px solid #5f97fc}div.ML__keyboard.material div div.rows ul li.bigfnbutton.active,div.ML__keyboard.material div div.rows ul li.bigfnbutton.pressed,div.ML__keyboard.material div div.rows ul li.bigfnbutton:active,div.ML__keyboard.material div div.rows ul li.bigfnbutton:hover,div.ML__keyboard.material div div.rows ul li.fnbutton.active,div.ML__keyboard.material div div.rows ul li.fnbutton.pressed,div.ML__keyboard.material div div.rows ul li.fnbutton:active,div.ML__keyboard.material div div.rows ul li.fnbutton:hover{border:0;color:#5f97fc;fill:currentColor;background:var(--keycap-background-active);box-shadow:none}@media (prefers-color-scheme:dark){body:not([theme=light]) div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue,212),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue,212),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue,212),35%,40%);--keycap-modifier-border:hsl(var(--hue,212),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue,212),35%,42%);--keyboard-alternate-background:hsl(var(--hue,212),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue,212),35%,42%);--keyboard-alternate-text:#d1d1d1}}body[theme=dark] div.ML__keyboard.material{--hue:198;--keyboard-background:hsl(var(--hue,212),19%,18%);--keyboard-text:#d4d6d7;--keyboard-text-active:#5f97fc;--keyboard-background-border:#333;--keycap-background:hsl(var(--hue,212),25%,39%);--keycap-background-active:#5f97fc;--keycap-background-border:transparent;--keycap-background-border-bottom:transparent;--keycap-text:#d0d0d0;--keycap-text-active:#d4d6d7;--keycap-secondary-text:#5f97fc;--keycap-modifier-background:hsl(var(--hue,212),35%,40%);--keycap-modifier-border:hsl(var(--hue,212),35%,35%);--keycap-modifier-border-bottom:hsl(var(--hue,212),35%,42%);--keyboard-alternate-background:hsl(var(--hue,212),8%,2%);--keyboard-alternate-background-active:hsl(var(--hue,212),35%,42%);--keyboard-alternate-text:#d1d1d1}'),Rd["foreground-color"]=[];for(const e of Pa)Rd["foreground-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"color":"'+e+'"}]'});Rd["background-color"]=[];for(const e of Da)Rd["background-color"].push({classes:"small-button",content:'',command:'["applyStyle",{"backgroundColor":"'+e+'"}]'});Bd={...Rd},Object.keys(Bd).forEach((e=>{Bd[e]=Bd[e].slice()}));for(let e=0;e<26;e++){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[e];Bd[t]||(Bd[t]=[]),Bd[t].unshift({latex:"\\mathbb{"+t+"}",aside:"blackboard",insert:"\\mathbb{"+t+"}"}),Bd[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Bd[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Bd[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Bd[t].unshift({latex:"\\mathcal{"+t+"}",aside:"calligraphy",insert:"\\mathcal{"+t+"}"}),Bd[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<=26;e++){const t="abcdefghijklmnopqrstuvwxyz"[e];Bd[t]||(Bd[t]=[]),Bd[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Bd[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Bd[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Bd[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}for(let e=0;e<10;e++){const t="0123456789"[e];Bd[t]||(Bd[t]=[]),Bd[t].unshift({latex:"\\mathbf{"+t+"}",aside:"bold",insert:"\\mathbf{"+t+"}"}),Bd[t].unshift({latex:"\\mathsf{"+t+"}",aside:"sans",insert:"\\mathsf{"+t+"}"}),Bd[t].unshift({latex:"\\mathtt{"+t+"}",aside:"monospace",insert:"\\mathtt{"+t+"}"}),Bd[t].unshift({latex:"\\mathcal{"+t+"}",aside:"script",insert:"\\mathcal{"+t+"}"}),Bd[t].unshift({latex:"\\mathfrak{"+t+"}",aside:"fraktur",insert:"\\mathfrak{"+t+"}"})}let i=e.options.virtualKeyboards;i||(i="all"),i=i.replace(/\ball\b/i,"numeric functions symbols roman greek");const a={...jd,...null!==(n=e.options.customVirtualKeyboardLayers)&&void 0!==n?n:{}},s={...Id,...null!==(r=e.options.customVirtualKeyboards)&&void 0!==r?r:{}},l=i.replace(/\s+/g," ").split(" ");for(const t of l){if(!s[t]){console.error('Unknown virtual keyboard "'+t+'"');break}let n=s[t].layers||[];s[t].layer&&n.push(s[t].layer),n=Array.from(new Set(n));for(const r of n){if(!a[r]){console.error('Unknown virtual keyboard layer: "'+r+'"');break}if("object"==typeof a[r]){const e=a[r];let t="";if(e.styles&&(t+=``),e.backdrop&&(t+=`
    `),e.container&&(t+=`
    `),e.rows){t+="
    ";for(const n of e.rows){t+="
      ";for(const e of n)t+="${e.label?e.label:""}`;t+="
    "}t+="
    "}e.container&&(t+="
    "),e.backdrop&&(t+="
    "),a[r]=t}o+="
    ",o+=Kd(e,i,t),o+=Fd(e,a[r]),o+="
    "}}const c=new Pd(e);c.element.className="ML__keyboard",t?c.element.classList.add(t):e.options.virtualKeyboardTheme&&c.element.classList.add(e.options.virtualKeyboardTheme),c.element.innerHTML=e.options.createHTML(o),qd(e,[].slice.call(c.element.querySelectorAll(".keycap, .action, .fnbutton, .bigfnbutton")));const d=c.element.getElementsByClassName("layer-switch");for(let t=0;t{e.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()})),e.addEventListener("touchstart",(e=>{e.preventDefault(),e.stopPropagation()}),{passive:!1})})),u[0].classList.add("is-visible"),c}(e,t),Wl(e.virtualKeyboard.element,"touchstart:passive mousedown",(()=>{e.focus()})),document.body.appendChild(e.virtualKeyboard.element)),window.setTimeout((()=>{var t;null===(t=e.virtualKeyboard)||void 0===t||t.element.classList.add("is-visible")}),1)):(null===(r=e.virtualKeyboard)||void 0===r?void 0:r.element)&&e.virtualKeyboard.element.classList.remove("is-visible"),(null===(o=e.virtualKeyboard)||void 0===o?void 0:o.element)&&"function"==typeof e.options.onVirtualKeyboardToggle&&e.options.onVirtualKeyboardToggle(e,e.virtualKeyboardVisible,e.virtualKeyboard.element),!1}Lc({showAlternateKeys:(e,t,n)=>{var r,o;const i=Ul("mathlive-alternate-keys-panel","ML__keyboard alternate-keys");(null===(r=e.virtualKeyboard)||void 0===r?void 0:r.element.classList.contains("material"))&&i.classList.add("material"),n.length>=7?i.style.width="286px":4===n.length||2===n.length?i.style.width="146px":1===n.length?i.style.width="86px":i.style.width="146px",i.style.height="auto";let a="";for(const e of n)a+="";a="
      "+a+"
    ",i.innerHTML=e.options.createHTML(a),qd(e,[].slice.call(i.getElementsByTagName("li")),"performAlternateKeys");const s=(null===(o=e.virtualKeyboard)||void 0===o?void 0:o.element.querySelector('div.keyboard-layer.is-visible div.rows ul li[data-alt-keys="'+t+'"]')).getBoundingClientRect();if(s){s.top-i.clientHeight<0&&(i.style.width="auto",n.length<=6?i.style.height="56px":n.length<=12?i.style.height="108px":i.style.height="205px");const e=(s.top-i.clientHeight+5).toString()+"px",t=Math.max(0,Math.min(window.innerWidth-i.offsetWidth,(s.left+s.right-i.offsetWidth)/2))+"px";i.style.transform="translate("+t+","+e+")",i.classList.add("is-visible")}return!1}},{target:"virtual-keyboard"}),Lc({shiftKeyboardLayer:e=>{var t;const n=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.element.querySelectorAll("div.keyboard-layer.is-visible .rows .keycap, div.keyboard-layer.is-visible .rows .action");if(n)for(let t=0;tHd(),performAlternateKeys:(e,t)=>(Hd(),e.executeCommand(t)),switchKeyboardLayer:(e,t)=>Ud(e,t),unshiftKeyboardLayer:e=>Wd(e),insertAndUnshiftKeyboardLayer:(e,t)=>(e.insert(t),Wd(e),!0)},{target:"virtual-keyboard"}),Lc({toggleVirtualKeyboardAlt:e=>{var t,n;let r=!1;return(null===(t=e.virtualKeyboard)||void 0===t?void 0:t.element)&&(r=null===(n=e.virtualKeyboard)||void 0===n?void 0:n.element.classList.contains("material"),e.virtualKeyboard.dispose(),delete e.virtualKeyboard),Zd(e,r?"":"material"),!1},toggleVirtualKeyboardShift:e=>{var t,n;e.options.virtualKeyboardLayout={qwerty:"azerty",azerty:"qwertz",qwertz:"dvorak",dvorak:"colemak",colemak:"qwerty"}[e.options.virtualKeyboardLayout];const r=null!==(n=null===(t=e.virtualKeyboard)||void 0===t?void 0:t.element.querySelector("div.keyboard-layer.is-visible").id)&&void 0!==n?n:"";return e.virtualKeyboard&&(e.virtualKeyboard.dispose(),delete e.virtualKeyboard),Zd(e),r&&Ud(e,r),!1}},{target:"virtual-keyboard"}),Lc({toggleVirtualKeyboard:(e,t)=>Xd(e,t),hideVirtualKeyboard:e=>Gd(e),showVirtualKeyboard:(e,t)=>Zd(e,t)},{target:"virtual-keyboard"});const Yd={"\\imaginaryI":"ⅈ","\\imaginaryJ":"ⅉ","\\pi":"π","\\exponentialE":"ℯ","﹢":"+","+":"+","−":"-","-":"-","﹣":"-","-":"-","\\times":"*","\\cdot":"*","⨉":"*","️✖":"*","️×":"*",".":"*","÷":"/","⁄":"/","/":"/","!":"factorial","\\mp":"minusplus","\\ne":"!=","\\coloneq":":=","\\questeq":"?=","\\approx":"approx","\\cong":"congruent","\\sim":"similar","\\equiv":"equiv","\\pm":"plusminus","\\land":"and","\\wedge":"and","\\lor":"or","\\vee":"or","\\oplus":"xor","\\veebar":"xor","\\lnot":"not","\\neg":"not","\\exists":"exists","\\nexists":"!exists","\\forall":"forAll","\\backepsilon":"suchThat","\\therefore":"therefore","\\because":"because","\\nabla":"nabla","\\circ":"circle","\\ominus":"ominus","\\odot":"odot","\\otimes":"otimes","\\zeta":"Zeta","\\Gamma":"Gamma","\\min":"min","\\max":"max","\\mod":"mod","\\lim":"lim","\\sum":"sum","\\prod":"prod","\\int":"integral","\\iint":"integral2","\\iiint":"integral3","\\Re":"Re","\\gothicCapitalR":"Re","\\Im":"Im","\\gothicCapitalI":"Im","\\binom":"nCr","\\partial":"partial","\\differentialD":"differentialD","\\capitalDifferentialD":"capitalDifferentialD","\\Finv":"Finv","\\Game":"Game","\\wp":"wp","\\ast":"ast","\\star":"star","\\asymp":"asymp","\\to":"to","\\gets":"gets","\\in":"elementof","\\notin":"!elementof","\\ni":"ownedby","\\owns":"ownedby","\\subset":"subset","\\supset":"superset","\\complement":"complement","\\rightarrow":"shortLogicalImplies","\\leftarrow":"shortLogicalImpliedBy","\\leftrightarrow":"shortLogicalEquivalent","\\longrightarrow":"logicalImplies","\\longleftarrow":"logicalImpliedBy","\\longleftrightarrow":"logicalEquivalent","\\Rightarrow":"shortImplies","\\Leftarrow":"shortImpliedBy","\\Leftrightarrow":"shortEquivalent","\\implies":"implies","\\Longrightarrow":"implies","\\impliedby":"impliedBy","\\Longleftarrow":"impliedBy","\\iff":"equivalent","\\Longleftrightarrow":"equivalent"},Jd={"+":"add","*":"multiply","-":"subtract","/":"divide","=":"equal",":=":"assign","!=":"ne","?=":"questeq",approx:"approx",congruent:"congruent",similar:"similar",equiv:"equiv","<":"lt",">":"gt","<=":"le",">=":"ge","≤":"le","≥":"ge",">>":"gg","<<":"ll","**":"pow","++":"increment","--":"decrement"},Qd={equal:"%0 = %1",ne:"%0 \\ne %1",questeq:"%0 \\questeq %1",approx:"%0 \\approx %1",congruent:"%0 \\cong %1",similar:"%0 \\sim %1",equiv:"%0 \\equiv %1",assign:"%0 := %1",lt:"%0 < %1",gt:"%0 > %1",le:"%0 \\le %1",ge:"%0 \\ge %1",sin:"\\sin%_%^ %0",cos:"\\cos%_%^ %0",tan:"\\tan%_%^ %0",cot:"\\cot%_%^ %0",sec:"\\sec%_%^ %0",csc:"\\csc%_%^ %0",sinh:"\\sinh %0",cosh:"\\cosh %0",tanh:"\\tanh %0",csch:"\\csch %0",sech:"\\sech %0",coth:"\\coth %0",arcsin:"\\arcsin %0",arccos:"\\arccos %0",arctan:"\\arctan %0",arccot:"\\arcctg %0",arcsec:"\\arcsec %0",arccsc:"\\arccsc %0",arsinh:"\\arsinh %0",arcosh:"\\arcosh %0",artanh:"\\artanh %0",arcsch:"\\arcsch %0",arsech:"\\arsech %0",arcoth:"\\arcoth %0",ln:"\\ln%_%^ %",log:"\\log%_%^ %",lg:"\\lg %",lb:"\\lb %",sum:"\\sum%_%^ %0",prod:"\\prod%_%^ %0",Zeta:"\\zeta%_%^ %",Gamma:"\\Gamma %",min:"\\min%_%^ %",max:"\\max%_%^ %",mod:"\\mod%_%^ %",lim:"\\lim%_%^ %",binom:"\\binom %",nabla:"\\nabla %",curl:"\\nabla\\times %0",div:"\\nabla\\cdot %0",floor:"\\lfloor %0 \\rfloor%_%^",ceil:"\\lceil %0 \\rceil%_%^",abs:"\\left| %0 \\right|%_%^",norm:"\\lVert %0 \\rVert%_%^",ucorner:"\\ulcorner %0 \\urcorner%_%^",lcorner:"\\llcorner %0 \\lrcorner%_%^",angle:"\\langle %0 \\rangle%_%^",group:"\\lgroup %0 \\rgroup%_%^",moustache:"\\lmoustache %0 \\rmoustache%_%^",brace:"\\lbrace %0 \\rbrace%_%^","sqrt[]":"\\sqrt[%^]{%0}",sqrt:"\\sqrt{%0}",lcm:"\\operatorname{lcm}%",gcd:"\\operatorname{gcd}%",erf:"\\operatorname{erf}%",erfc:"\\operatorname{erfc}%",randomReal:"\\operatorname{randomReal}%",randomInteger:"\\operatorname{randomInteger}%",and:"%0 \\land %1",or:"%0 \\lor %1",xor:"%0 \\oplus %1",not:"%0 \\lnot %1",circle:"%0 \\circ %1",ast:"%0 \\ast %1",star:"%0 \\star %1",asymp:"%0 \\asymp %1","/":"\\frac{%0}{%1}",Re:"\\Re{%0}",Im:"\\Im{%0}",factorial:"%0!",factorial2:"%0!!"},eu={degree:880,nabla:740,curl:740,partial:740,differentialD:740,capitalDifferentialD:740,"**":720,odot:710,not:680,div:660,solidus:660,"/":660,setminus:650,"%":640,otimes:410,union:350,intersection:350,"*":390,ast:390,".":390,oplus:300,ominus:300,"+":275,"-":275,"+-":275,"-+":275,circle:265,circledast:265,circledcirc:265,star:265,"..":263,to:262,in:262,"|":261,congruent:265,equiv:260,"=":260,"!=":255,"?=":255,similar:250,approx:247,"<":245,">":243,">=":242,"≥":242,"<=":241,complement:240,subset:240,superset:240,elementof:240,"!elementof":240,exists:230,"!exists":230,forall:230,and:200,xor:195,or:190,suchThat:110,":":100,assign:80,":=":80,therefore:70,because:70,shortLogicalImplies:52,shortImplies:51,logicalImplies:50,implies:49,shortLogicalImpliedBy:48,shortImpliedBy:47,logicalImpliedBy:46,impliedBy:45,shortLogicalEquivalent:44,shortEquivalent:43,logicalEquivalent:42,equivalent:41,",":40,";":30};function tu(e,t){return si(e.arg)?e.arg[t]:void 0}function nu(e){return e&&eu[e]||-1}function ru(e){return/=|=>/.test(e)?"right":"left"}function ou(e){if("f"===e||"g"===e)return!0;const t=Qd[e];return!!t&&!!/%[^01_^]?/.test(t)}function iu(e){e=(e||"").trim();let t=Yd[e];if(!t)if(/^\\[^{}]+$/.test(e)){const n=ka(e,"math",{});t=n&&n.value||e.slice(1)}else t=e;return t}function au(e){if(!e)return null;const t=iu(pu(e)),n=[nu(t),ru(t)];return n[0]<=0?null:n}function su(e){return null!==au(e)}const lu={"\\lfloor\\rfloor":"floor","\\lceil\\rceil":"ceil","\\vert\\vert":"abs","\\lvert\\rvert":"abs","||":"abs","\\Vert\\Vert":"norm","\\lVert\\rVert":"norm","\\ulcorner\\urcorner":"ucorner","\\llcorner\\lrcorner":"lcorner","\\langle\\rangle":"angle","\\lgroup\\rgroup":"group","\\lmoustache\\rmoustache":"moustache","\\lbrace\\rbrace":"brace"},cu={"!":"factorial","\\dag":"dagger","\\dagger":"dagger","\\ddagger":"dagger2","\\maltese":"maltese","\\backprime":"backprime","\\backdoubleprime":"backprime2","\\prime":"prime","\\doubleprime":"prime2","\\$":"$","\\%":"%","\\_":"_","\\degree":"degree"},du={"+":"add","-":"add","*":"multiply","=":"equal",",":"list",";":"list2",and:"and",or:"or",xor:"xor",union:"union",shortLogicalEquivalent:"logicalEquivalent",logicalEquivalent:"logicalEquivalent",shortEquivalent:"equivalent",equivalent:"equivalent"},uu={",":"list",";":"list2"};function pu(e){if("string"==typeof e)return e;if(si(e)){let t="";for(const n of e)t+=pu(n);return t}if(e.symbol&&!/^\\math(op|bin|rel|open|punct|ord|inner)/.test(e.symbol))return e.symbol;if("leftright"===e.type)return"";if("string"==typeof e.body)return e.body;if(si(e.body)){let t="";for(const n of e.body)t+=pu(n);return t}return""}function hu(e){return"string"==typeof e.sym?function(e){let t=Qd[e];return t?t.replace("%1","").replace("%0","").replace("%",""):(e.length>1&&(t="\\"+e),t||(t=va("math",e)),t)}(e.sym)||e.sym:""}function fu(e){return parseFloat(e.num)}function mu(e){return"object"==typeof e&&void 0!==e.num}function gu(e){let t=0;return mu(e)&&(t="object"==typeof e.num?void 0!==e.num.re?Bu(e.num.re):0:parseFloat(e.num)),t}function yu(e){let t=0;return mu(e)&&"object"==typeof e.num&&(t=void 0!==e.num.im?Bu(e.num.im):0),t}function vu(e){return e&&void 0!==e.sup}function bu(e){return e&&void 0!==e.sub}function xu(e,t,n){let r=!1;const o=e.atoms[e.index];return o&&o.type===t&&(r=void 0===n||pu(o)===n),r}function wu(e,...t){const n={fn:e,arg:void 0};if(t){const e=[];for(const n of t)n&&e.push(n);e.length>0&&(n.arg=e)}return n}function ku(e){return"number"==typeof e?{num:e.toString()}:"string"==typeof e?{num:e}:"object"==typeof e?(console.assert("string"==typeof e.re||"string"==typeof e.im),{num:e}):void 0}function _u(e){if(mu(e)){const t=gu(e),n=yu(e);return 0!==n?(0!==t&&(e.num.re=(-t).toString()),e.num.im=(-n).toString()):e.num=(-t).toString(),e}return wu("negate",e)}function Mu(e){const t=e.atoms[e.index+1];return t&&"msubsup"===t.type}function Su(e,t){let n=e.atoms[e.index];return!n||void 0===n.superscript&&void 0===n.subscript?n=null:e.index+=1,n||(n=e.atoms[e.index+1],n&&"msubsup"===n.type&&(n.superscript||n.subscript)?e.index+=2:n=null),n?(void 0!==n.subscript&&(e.ast.sub=Pu(n.subscript,t)),void 0!==n.superscript&&("msubsup"===n.type?/['\u2032]|\\prime/.test(pu(n.superscript))?(e.index+=1,n=e.atoms[e.index+1],n&&"msubsup"===n.type&&/['\u2032]|\\prime/.test(pu(n.superscript))?e.ast.sup={sym:"″"}:(e.ast.sup={sym:"′"},e.index-=1)):/['\u2033]|\\doubleprime/.test(pu(n.superscript))?e.ast.sup={sym:"″"}:e.ast&&(e.ast.sup=Pu(n.superscript,t)):e.ast.sup=Pu(n.superscript,t))):e.index+=1,e}function Eu(e,t){const n=e.ast;if(Cu(e,"!!"))return e.index+=1,e.ast=wu("factorial2",n),Eu(e=Su(e,t),t);if(Cu(e,"++"))return e.index+=1,e.ast=wu("increment",n),Eu(e=Su(e,t),t);if(Cu(e,"--"))return e.index+=1,e.ast=wu("decrement",n),Eu(e=Su(e,t),t);const r=e.atoms[e.index];return(null==r?void 0:r.symbol)&&cu[r.symbol]&&(e.ast=wu(cu[r.symbol],n),e=Eu(e=Su(e,t),t)),e}function zu(e,t,n,r){if(e.index=e.index||0,0===e.atoms.length||e.index>=e.atoms.length)return e.ast=void 0,e;const o=e.minPrec;e.minPrec=0;let i=e.atoms[e.index];if(t){if("mopen"===i.type&&pu(i)===t)e.index+=1,i=(e=Tu(e,r)).atoms[e.index],i&&"mclose"===i.type&&pu(i)===n&&(Mu(e)&&(e.ast={group:e.ast}),e=Eu(e=Su(e,r),r));else if("textord"===i.type&&pu(i)===t)e.index+=1,i=(e=Tu(e,r)).atoms[e.index],i&&"textord"===i.type&&pu(i)===n&&(e.index+=1,e=Eu(e=Su(e,r),r));else if("\\lVert"===t&&"textord"===i.type&&"|"===i.symbol){if(i=e.atoms[e.index+1],i&&"textord"===i.type&&"|"===i.symbol){e.index+=2,i=(e=Tu(e,r)).atoms[e.index];const t=e.atoms[e.index+1];i&&"textord"===i.type&&"|"===i.symbol&&t&&"textord"===t.type&&"|"===t.symbol&&(e.index+=2,e=Eu(e=Su(e,r),r))}}else if("sizeddelim"===i.type&&i.delim===t)e.index+=1,i=(e=Tu(e,r)).atoms[e.index],i&&"sizeddelim"===i.type&&i.delim===n&&(e.index+=1,e=Eu(e=Su(e,r),r));else{if("leftright"!==i.type||i.leftDelim!==t||"?"!==i.rightDelim&&i.rightDelim!==n)return;e.ast=Pu(i.body,r),Mu(e)&&(e.ast={group:e.ast}),e=Eu(e=Su(e,r),r)}return e.minPrec=o,e}{let a=!0;if("mopen"===i.type?(t=i.symbol,n=aa[t]):"sizeddelim"===i.type?(t=i.delim,n=aa[t]):"leftright"===i.type?(a=!1,t=i.leftDelim,"?"===(n=i.rightDelim)&&(n=aa[t])):"textord"===i.type&&(t=i.symbol,n=aa[t]),t&&n){if("|"===t&&"|"===n){const r=e.atoms[e.index+1];r&&"textord"===r.type&&"|"===r.symbol&&(t="\\lVert",n="\\rVert")}if(e=zu(e,t,n,r))return a&&(e.index+=1),e.ast={fn:lu[t+n]||t+n,arg:[e.ast]},e.minPrec=o,e}}}function Cu(e,t){return e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)&&t===pu(e.atoms[e.index])+pu(e.atoms[e.index+1])}function Lu(e){if(e.index=e.index||0,!(e.atoms.length<=1||e.index>=e.atoms.length-1)){if(!xu(e,"textord","\\nabla")){const t=e.atoms[e.index].symbol+e.atoms[e.index+1].symbol,n=/^(>=|<=|>>|<<|:=|!=)$/.test(t)?t:"";return n&&(e.index+=1),n}return e.index+=1,xu(e,"mbin","\\times")?(e.index+=1,e.ast="curl",e):xu(e,"mbin","\\cdot")?(e.index+=1,e.ast="div",e):void(e.index-=1)}}function Ou(e,t){if(e.index=e.index||0,e.ast=void 0,0===e.atoms.length||e.index>=e.atoms.length)return e;let n=e.atoms[e.index];if("text"===n.mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;return e.ast={text:t},e}const r=iu(pu(n));if(Lu(e))e.ast=wu(e.ast,Ou(e,t).ast);else{if("root"===n.type)return e.index=0,e.atoms=n.body,Ou(e,t);if("mbin"===n.type&&"-"===r)e.index+=1,(e=Ou(e,t)).ast=_u(e.ast);else if("mbin"===n.type&&"+"===r)e.index+=1,(e=Ou(e,t)).ast=wu("add",e.ast);else if("mord"===n.type&&/^[0-9.]$/.test(n.symbol)){let r="",o=!1,i=/^[0-9.eEdD]$/;for(;e.index=e.atoms.length)return e;e.minPrec=e.minPrec||0;let n=Ou(e,t).ast,r=!1;const o=e.minPrec;for(;!r;){const i=e.atoms[e.index],a=Lu(e);let s,l;if(r=!i||"text"===i.mode||!a&&!su(i),r||([s,l]=a?[nu(a),ru(a)]:au(i),r=s0&&"\\"===d.charAt(0)&&"string"==typeof e.body&&(d=e.body)),l=ga(d,u,p).replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),l!==d?(c={sym:l},u="normal"):c={sym:d};break;case"box":c=Pu(e.body,t);break;case"array":if("cardinality"===e.environmentName)c=wu("card",Pu(e.array,t));else if(/array|matrix|pmatrix|bmatrix/.test(e.environmentName)){c={fn:"array",args:[]};for(const n of e.array)c.args.push(n.map((e=>Pu(e,t))))}else if("cases"===e.environmentName){c={fn:"cases",args:[]};for(const n of e.array)if(n[0]){const e=[];e.push(Pu(n[0],t));let r=Pu(n[1],t);r&&"text"===r.fn&&r.arg&&/^(if|when|for)$/i.test(r.arg[0].trim())&&(r=r.arg.filter((e=>"string"!=typeof e))),e.push(null!=r?r:{}),c.args.push(e)}}break;default:c=void 0,console.warn('Unhandled atom "'+e.type+'" in "'+(e.symbol||e.body)+'"')}return c&&u&&"normal"!==u&&(c.variant=u),c&&"string"==typeof e.cssClass&&(c.class=e.cssClass),c&&"string"==typeof e.cssId&&(c.id=e.cssId),c}function Du(e){if(!e)return[];let t;if(si(e)){t=[];for(const n of e){const e=Du(n);t=t.concat(e)}}else{if("spacing"===e.type||"first"===e.type)return[];"box"===e.type?t=Du(e.body):(e.body&&si(e.body)&&(e.body=Du(e.body)),e.superscript&&si(e.superscript)&&(e.superscript=Du(e.superscript)),e.subscript&&si(e.subscript)&&(e.subscript=Du(e.subscript)),e.index&&si(e.index)&&(e.index=Du(e.index)),e.denom&&si(e.denom)&&(e.denom=Du(e.denom)),e.numer&&si(e.numer)&&(e.numer=Du(e.numer)),e.array&&si(e.array)&&(e.array=e.array.map((e=>e.map((e=>Du(e)))))),t=[e])}return t}function Pu(e,t){return function(e,t){e.index=e.index||0,e.ast=void 0;const n=[];for(;e.atoms[e.index];)if("text"===e.atoms[e.index].mode){let t="";for(;e.atoms[e.index]&&"text"===e.atoms[e.index].mode;)t+=e.atoms[e.index].body,e.index+=1;n.push(wu("text",t))}else{const r=Tu(e,t).ast;if(!r)return;n.push(r)}return n.length>1?wu("sequence",...n):n[0]||void 0}({atoms:Du(e)},t)}function Iu(e,t){return Pu(e,t)}function Nu(e,...t){e=e||".. ";let n="";if(t.length>0){"."!==e[0]&&(n+=e[0]);let r="";for(const o of t)n+=r+o,r=e[2];"."!==e[1]&&(n+=e[1])}return n}function Ru(e,t){const n=e.length;e=e.substr(0,t.precision-2);for(let n=0;n1&&(r+i.repeat(a+1)).startsWith(e))return"0"===i?r.replace(/(\d{3})/g,"$1"+t.groupSeparator):r.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.beginRepeatingDigits+i.replace(/(\d{3})/g,"$1"+t.groupSeparator)+t.endRepeatingDigits}}return n!==e.length&&(e+="\\ldots"),e.replace(/(\d{3})/g,"$1"+t.groupSeparator)}function Bu(e){return parseFloat(parseFloat(e).toPrecision(15))}function ju(e,t){let n,r="";if("number"==typeof t.precision){if("number"!=typeof e){let n="",r="";if("-"===e[0]?(n="-",e=e.substr(1)):"+"===e[0]&&(e=e.substr(1)),e.indexOf(".")>=0){const o=e.match(/(\d*).(\d*)([e|E]([-+]?[0-9]*))?/),i=o[1],a=o[2].substring(0,Math.min(t.precision-i.length,o[2].length));if(r=o[4]||"","0"===i){let r=0;for(;"0"===a[r]&&r=t.precision)o="0",n="";else{o=e[r];const n=Ru(e.substr(r+1),t);n&&(o+=t.decimalMarker+n)}"0"!==o&&(e.length-1>t.precision&&!o.endsWith("}")&&!o.endsWith("\\ldots")&&(o+="\\ldots"),r>4&&(o+=t.exponentProduct,t.exponentMarker?o+=t.exponentMarker+(1-r).toString():o+="10^{"+(1-r).toString()+"}")),e=o}else{e=i.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);const n=Ru(a,t);n&&(e+=t.decimalMarker+n)}}else if(e.length>t.precision){const n=e.length;let r=e[0];const o=Ru(e.substr(2),t);o&&(r+=t.decimalMarker+o,"}"!==r[r.length-1]&&(r+="\\ldots")),"1"!==r?r+=t.exponentProduct:r="",t.exponentMarker?r+=t.exponentMarker+(n-2).toString():r+="10^{"+(n-2).toString()+"}",e=r}else e=e.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator);return r&&(r=t.exponentMarker?t.exponentMarker+r:t.exponentProduct+" 10^{"+r+"}"),n+e+r}n=Bu(e)}if("engineering"===t.scientificNotation)if(0===n)r="0";else{const e=Math.abs(n);let o=Math.round(Math.log10(e));o-=o%3,e<1e3&&(o=0);const i=e/Math.pow(10,o);let a="";const s=i.toString().match(/^(.*)\.(.*)$/);(null==s?void 0:s[1])&&s[2]&&(a=s[1]+t.decimalMarker+s[2]),t.groupSeparator&&(a=Ru(i.toExponential(),t));let l="";l=0===o?"":t.exponentMarker?t.exponentMarker+o:t.exponentProduct+" 10^{"+o+"}",r=(n<0?"-":"")+a+l}else{const n="string"==typeof e?e:e.toString();let o,i,a,s=n.match(/^(.*)[e|E]([-+]?[0-9]*)$/i);o=n,a="",(null==s?void 0:s[1])&&s[2]&&(o=s[1],i=t.exponentMarker?t.exponentMarker+s[2]:t.exponentProduct+" 10^{"+s[2]+"}"),s=o.match(/^(.*)\.(.*)$/),(null==s?void 0:s[1])&&s[2]&&(o=s[1],a=s[2]),t.groupSeparator&&(o=o.replace(/\B(?=(\d{3})+(?!\d))/g,t.groupSeparator),a=Ru(a,t)),a&&(a=t.decimalMarker+a),r=o+a+(i||"")}return r}function $u(e,t){const n=Object.assign({precision:14,decimalMarker:".",groupSeparator:"\\, ",product:"\\cdot ",exponentProduct:"\\cdot ",exponentMarker:"",arcSeparator:"\\,",scientificNotation:"auto",beginRepeatingDigits:"\\overline{",endRepeatingDigits:"}"},t);let r="";if(void 0===e)return"";if("string"==typeof e)r=e;else if(e.latex)r=e.latex;else if(mu(e)){const t=fu(e);if(t===-1/0)r="-\\infty ";else if(t===1/0)r="\\infty ";else if("object"!=typeof e.num||"string"!=typeof e.num.re&&"string"!=typeof e.num.im)r=isNaN(t)?"\\text{NaN}":ju(e.num,n);else{const t=gu(e),o=yu(e);isNaN(t)||isNaN(o)?r="\\text{NaN}":Math.abs(o)<=Number.EPSILON&&Math.abs(t)<=Number.EPSILON?r="0":(Math.abs(t)>Number.EPSILON&&(r=ju(t,n)),Math.abs(o)>Number.EPSILON&&(Math.abs(t)>Number.EPSILON&&(r+=o>0?"+":""),r+=(1!==Math.abs(o)?ju(o,n):"")+"\\imaginaryI "))}vu(e)&&(r+="^{"+$u(e.sup,n)+"}"),bu(e)&&(r+="_{"+$u(e.sub,n)+"}")}else if(e.group)r=$u(e.group,n),mu(e.group)||hu(e.group)?0!==yu(e.group)&&(r=Nu(e.fence||"(),",r)):r=Nu(e.fence||"(),",r),vu(e)&&(r+="^{"+$u(e.sup,n)+"}"),bu(e)&&(r+="_{"+$u(e.sub,n)+"}");else if(e.fn)if("bind"===e.fn){if(r=$u(tu(e,0),n)+"|_{",e.arg&&2===e.arg.length)r+=$u(tu(e,1));else{let t="";for(let n=1;n$u(e,n))));else if("text"===e.fn)r="\\text{"+(e.arg[0]||"")+"}";else if("pow"===e.fn&&si(e.arg)&&e.arg.length>=2)r=$u(tu(e,0),n),mu(tu(e,0))||hu(tu(e,0))||(r=Nu(e.fence||"(),",r)),r+="^{"+$u(tu(e,1),n)+"}";else if("equal"===e.fn&&e.arg&&e.arg.length>2)r=e.arg.map((e=>$u(e,n))).join(" = ");else{const t=function(e){let t=Qd[e];return t||(t=e.length>1?"\\operatorname{"+e+"}%^%_ %":e+"%^%_ %"),t}(e.fn);r=t;let o="";if(/%(?![01_^])/.test(t)&&si(e.arg)&&e.arg.length>1)r+=Nu(e.fence||"(),",...e.arg.map((e=>$u(e,n))));else if(si(e.arg)&&e.arg.length>0){const i=$u(tu(e,0),n),a=$u(tu(e,1),n),s=[...e.arg];/%0/.test(t)&&(r=r.replace("%0",i),s.shift()),/%1/.test(t)&&(r=r.replace("%1",a),s.shift()),s.length>0&&(o=Nu(e.fence||"(),",...s.map((e=>$u(e,n)))))}else o=Nu(e.fence||"(),","");r=vu(e)?r.replace("%^","^{"+$u(e.sup,n)+"}"):r.replace("%^",""),r=bu(e)?r.replace("%_","_{"+$u(e.sub,n)+"}"):r.replace("%_",""),r=r.replace(/%(?![01_^])/,o),r=r.replace("%0","").replace("%1","")}else{const t=[];for(const r of e.arg)"add"===r.fn||"subtract"===r.fn||0!==gu(o=r)&&0!==yu(o)||vu(e)&&0!==yu(r)&&1!==yu(r)?t.push(Nu("() ",$u(r,n))):t.push($u(r,n));if("multiply"===e.fn)r=!e.arg||2!==e.arg.length||!mu(e.arg[0])&&"divide"!==e.arg[0].fn||mu(e.arg[1])&&(0!==gu(e.arg[1])||1!==yu(e.arg[1]))?t.join(" \\times "):t[0]+t[1];else if(e.arg&&1===e.arg.length)r="negate"===e.arg[0].fn||mu(e.arg[0])&&fu(e.arg[0])<0?t[0]:"+"+t[0];else{r=t[0];for(let n=1;ndocument.fonts.check("16px "+e)))}catch(e){r=!1}if(!r){if(document.body.classList.contains("ML__fonts-loading"))return;document.body.classList.add("ML__fonts-loading");const n=new URL(null!=e?e:"./fonts",Es).toString(),r=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular",{style:"italic"}],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map((e=>function(e,t,n={}){return new FontFace(e,`url(${t}.woff2) format('woff2'), url(${t}.woff) format('woff')`,n)}(e[0].replace(/-[a-zA-Z]+$/,""),n+"/"+e[0],e[1])));try{(await Promise.all(r.map((e=>{try{return e.load()}catch(e){"function"==typeof t&&t({code:"font-not-found",arg:e})}})))).forEach((e=>document.fonts.add(e))),document.body.classList.remove("ML__fonts-loading")}catch(e){console.error(e)}}}}(this.options.fontsDirectory,this.options.onError),this.stylesheets.push(zs(e,'.ML__sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}body.ML__fonts-loading .ML__base{visibility:hidden}.ML__base{visibility:inherit;display:inline-block;position:relative;cursor:text}.ML__strut,.ML__strut--bottom{display:inline-block;min-height:.5em}.ML__small-delim{font-family:KaTeX_Main}.ML__text{font-family:var(--text-font-family,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif);white-space:pre}.ML__cmr{font-family:KaTeX_Main;font-style:normal}.ML__mathit{font-family:KaTeX_Math;font-style:italic}.ML__mathbf{font-family:KaTeX_Main;font-weight:700}.lcGreek.ML__mathbf{font-family:KaTeX_Math;font-weight:400}.ML__mathbfit{font-family:KaTeX_Math;font-weight:700;font-style:italic}.ML__ams,.ML__bb{font-family:KaTeX_AMS}.ML__cal{font-family:KaTeX_Caligraphic}.ML__frak{font-family:KaTeX_Fraktur}.ML__tt{font-family:KaTeX_Typewriter}.ML__script{font-family:KaTeX_Script}.ML__sans{font-family:KaTeX_SansSerif}.ML__series_el,.ML__series_ul{font-weight:100}.ML__series_l{font-weight:200}.ML__series_sl{font-weight:300}.ML__series_sb{font-weight:500}.ML__bold,.ML__boldsymbol{font-weight:700}.ML__series_eb{font-weight:800}.ML__series_ub{font-weight:900}.ML__series_uc{font-stretch:ultra-condensed}.ML__series_ec{font-stretch:extra-condensed}.ML__series_c{font-stretch:condensed}.ML__series_sc{font-stretch:semi-condensed}.ML__series_sx{font-stretch:semi-expanded}.ML__series_x{font-stretch:expanded}.ML__series_ex{font-stretch:extra-expanded}.ML__series_ux{font-stretch:ultra-expanded}.ML__it{font-style:italic}.ML__shape_ol{-webkit-text-stroke:1px #000;text-stroke:1px #000;color:transparent}.ML__shape_sc{font-variant:small-caps}.ML__shape_sl{font-style:oblique}.ML__emph{color:#bc2612}.ML__emph .ML__emph{color:#0c7f99}.ML__highlight{color:#007cb2;background:#edd1b0}.ML__mathlive{display:inline-block;line-height:0;direction:ltr;text-align:left;text-indent:0;text-rendering:auto;font-family:KaTeX_Main;font-style:normal;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;text-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:-webkit-min-content;width:-moz-min-content;width:min-content;transform:translateZ(0)}.ML__mathlive .reset-textstyle.scriptstyle{font-size:.7em}.ML__mathlive .reset-textstyle.scriptscriptstyle{font-size:.5em}.ML__mathlive .reset-scriptstyle.textstyle{font-size:1.42857em}.ML__mathlive .reset-scriptstyle.scriptscriptstyle{font-size:.71429em}.ML__mathlive .reset-scriptscriptstyle.textstyle{font-size:2em}.ML__mathlive .reset-scriptscriptstyle.scriptstyle{font-size:1.4em}.ML__mathlive .style-wrap{position:relative}.ML__mathlive .vlist{display:inline-block}.ML__mathlive .vlist>span{display:block;height:0;position:relative;line-height:0}.ML__mathlive .vlist>span>span{display:inline-block}.ML__mathlive .msubsup{text-align:left}.ML__mathlive .mfrac>span{text-align:center}.ML__mathlive .mfrac .frac-line{width:100%}.ML__mathlive .mfrac .frac-line:after{content:"";display:block;margin-top:-.04em;min-height:.04em;background:currentColor;box-sizing:content-box;transform:translate(0)}.ML__mathlive .rspace.negativethinspace{margin-right:-.16667em}.ML__mathlive .rspace.thinspace{margin-right:.16667em}.ML__mathlive .rspace.negativemediumspace{margin-right:-.22222em}.ML__mathlive .rspace.mediumspace{margin-right:.22222em}.ML__mathlive .rspace.thickspace{margin-right:.27778em}.ML__mathlive .rspace.sixmuspace{margin-right:.333333em}.ML__mathlive .rspace.eightmuspace{margin-right:.444444em}.ML__mathlive .rspace.enspace{margin-right:.5em}.ML__mathlive .rspace.twelvemuspace{margin-right:.666667em}.ML__mathlive .rspace.quad{margin-right:1em}.ML__mathlive .rspace.qquad{margin-right:2em}.ML__mathlive .mspace{display:inline-block}.ML__mathlive .mspace.negativethinspace{margin-left:-.16667em}.ML__mathlive .mspace.thinspace{width:.16667em}.ML__mathlive .mspace.negativemediumspace{margin-left:-.22222em}.ML__mathlive .mspace.mediumspace{width:.22222em}.ML__mathlive .mspace.thickspace{width:.27778em}.ML__mathlive .mspace.sixmuspace{width:.333333em}.ML__mathlive .mspace.eightmuspace{width:.444444em}.ML__mathlive .mspace.enspace{width:.5em}.ML__mathlive .mspace.twelvemuspace{width:.666667em}.ML__mathlive .mspace.quad{width:1em}.ML__mathlive .mspace.qquad{width:2em}.ML__mathlive .llap,.ML__mathlive .rlap{width:0;position:relative}.ML__mathlive .llap>.inner,.ML__mathlive .rlap>.inner{position:absolute}.ML__mathlive .llap>.fix,.ML__mathlive .rlap>.fix{display:inline-block}.ML__mathlive .llap>.inner{right:0}.ML__mathlive .rlap>.inner{left:0}.ML__mathlive .rule{display:inline-block;border:0 solid;position:relative}.ML__mathlive .overline .overline-line,.ML__mathlive .underline .underline-line{width:100%}.ML__mathlive .overline .overline-line:before,.ML__mathlive .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block}.ML__mathlive .overline .overline-line:after,.ML__mathlive .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;min-height:thin;content:"";display:block;margin-top:-1px}.ML__mathlive .stretchy{display:block;position:absolute;width:100%;left:0;overflow:hidden}.ML__mathlive .stretchy:after,.ML__mathlive .stretchy:before{content:""}.ML__mathlive .stretchy svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.ML__mathlive .slice-1-of-2{left:0}.ML__mathlive .slice-1-of-2,.ML__mathlive .slice-2-of-2{display:inline-flex;position:absolute;width:50.2%;overflow:hidden}.ML__mathlive .slice-2-of-2{right:0}.ML__mathlive .slice-1-of-3{display:inline-flex;position:absolute;left:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-2-of-3{display:inline-flex;position:absolute;left:25%;width:50%;overflow:hidden}.ML__mathlive .slice-3-of-3{display:inline-flex;position:absolute;right:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-1-of-1{display:inline-flex;position:absolute;width:100%;left:0;overflow:hidden}.ML__mathlive .sqrt{display:inline-block}.ML__mathlive .sqrt>.sqrt-sign{font-family:KaTeX_Main;position:relative}.ML__mathlive .sqrt .sqrt-line{height:.04em;width:100%}.ML__mathlive .sqrt .sqrt-line:before{content:"";display:block;margin-top:-.04em;min-height:.04em;background:currentColor}.ML__mathlive .sqrt .sqrt-line:after{border-bottom-width:1px;content:" ";display:block;margin-top:-.1em;transform:translate(0)}.ML__mathlive .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.ML__mathlive .fontsize-ensurer,.ML__mathlive .sizing{display:inline-block}.ML__mathlive .fontsize-ensurer.reset-size1.size1,.ML__mathlive .sizing.reset-size1.size1{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size1.size2,.ML__mathlive .sizing.reset-size1.size2{font-size:1.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size3,.ML__mathlive .sizing.reset-size1.size3{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size1.size4,.ML__mathlive .sizing.reset-size1.size4{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size1.size5,.ML__mathlive .sizing.reset-size1.size5{font-size:2em}.ML__mathlive .fontsize-ensurer.reset-size1.size6,.ML__mathlive .sizing.reset-size1.size6{font-size:2.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size7,.ML__mathlive .sizing.reset-size1.size7{font-size:2.88em}.ML__mathlive .fontsize-ensurer.reset-size1.size8,.ML__mathlive .sizing.reset-size1.size8{font-size:3.46em}.ML__mathlive .fontsize-ensurer.reset-size1.size9,.ML__mathlive .sizing.reset-size1.size9{font-size:4.14em}.ML__mathlive .fontsize-ensurer.reset-size1.size10,.ML__mathlive .sizing.reset-size1.size10{font-size:4.98em}.ML__mathlive .fontsize-ensurer.reset-size2.size1,.ML__mathlive .sizing.reset-size2.size1{font-size:.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size2,.ML__mathlive .sizing.reset-size2.size2{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size2.size3,.ML__mathlive .sizing.reset-size2.size3{font-size:1.14285714em}.ML__mathlive .fontsize-ensurer.reset-size2.size4,.ML__mathlive .sizing.reset-size2.size4{font-size:1.28571429em}.ML__mathlive .fontsize-ensurer.reset-size2.size5,.ML__mathlive .sizing.reset-size2.size5{font-size:1.42857143em}.ML__mathlive .fontsize-ensurer.reset-size2.size6,.ML__mathlive .sizing.reset-size2.size6{font-size:1.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size7,.ML__mathlive .sizing.reset-size2.size7{font-size:2.05714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size8,.ML__mathlive .sizing.reset-size2.size8{font-size:2.47142857em}.ML__mathlive .fontsize-ensurer.reset-size2.size9,.ML__mathlive .sizing.reset-size2.size9{font-size:2.95714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size10,.ML__mathlive .sizing.reset-size2.size10{font-size:3.55714286em}.ML__mathlive .fontsize-ensurer.reset-size3.size1,.ML__mathlive .sizing.reset-size3.size1{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size3.size2,.ML__mathlive .sizing.reset-size3.size2{font-size:.875em}.ML__mathlive .fontsize-ensurer.reset-size3.size3,.ML__mathlive .sizing.reset-size3.size3{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size3.size4,.ML__mathlive .sizing.reset-size3.size4{font-size:1.125em}.ML__mathlive .fontsize-ensurer.reset-size3.size5,.ML__mathlive .sizing.reset-size3.size5{font-size:1.25em}.ML__mathlive .fontsize-ensurer.reset-size3.size6,.ML__mathlive .sizing.reset-size3.size6{font-size:1.5em}.ML__mathlive .fontsize-ensurer.reset-size3.size7,.ML__mathlive .sizing.reset-size3.size7{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size3.size8,.ML__mathlive .sizing.reset-size3.size8{font-size:2.1625em}.ML__mathlive .fontsize-ensurer.reset-size3.size9,.ML__mathlive .sizing.reset-size3.size9{font-size:2.5875em}.ML__mathlive .fontsize-ensurer.reset-size3.size10,.ML__mathlive .sizing.reset-size3.size10{font-size:3.1125em}.ML__mathlive .fontsize-ensurer.reset-size4.size1,.ML__mathlive .sizing.reset-size4.size1{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size4.size2,.ML__mathlive .sizing.reset-size4.size2{font-size:.77777778em}.ML__mathlive .fontsize-ensurer.reset-size4.size3,.ML__mathlive .sizing.reset-size4.size3{font-size:.88888889em}.ML__mathlive .fontsize-ensurer.reset-size4.size4,.ML__mathlive .sizing.reset-size4.size4{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size4.size5,.ML__mathlive .sizing.reset-size4.size5{font-size:1.11111111em}.ML__mathlive .fontsize-ensurer.reset-size4.size6,.ML__mathlive .sizing.reset-size4.size6{font-size:1.33333333em}.ML__mathlive .fontsize-ensurer.reset-size4.size7,.ML__mathlive .sizing.reset-size4.size7{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size4.size8,.ML__mathlive .sizing.reset-size4.size8{font-size:1.92222222em}.ML__mathlive .fontsize-ensurer.reset-size4.size9,.ML__mathlive .sizing.reset-size4.size9{font-size:2.3em}.ML__mathlive .fontsize-ensurer.reset-size4.size10,.ML__mathlive .sizing.reset-size4.size10{font-size:2.76666667em}.ML__mathlive .fontsize-ensurer.reset-size5.size1,.ML__mathlive .sizing.reset-size5.size1{font-size:.5em}.ML__mathlive .fontsize-ensurer.reset-size5.size2,.ML__mathlive .sizing.reset-size5.size2{font-size:.7em}.ML__mathlive .fontsize-ensurer.reset-size5.size3,.ML__mathlive .sizing.reset-size5.size3{font-size:.8em}.ML__mathlive .fontsize-ensurer.reset-size5.size4,.ML__mathlive .sizing.reset-size5.size4{font-size:.9em}.ML__mathlive .fontsize-ensurer.reset-size5.size5,.ML__mathlive .sizing.reset-size5.size5{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size5.size6,.ML__mathlive .sizing.reset-size5.size6{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size5.size7,.ML__mathlive .sizing.reset-size5.size7{font-size:1.44em}.ML__mathlive .fontsize-ensurer.reset-size5.size8,.ML__mathlive .sizing.reset-size5.size8{font-size:1.73em}.ML__mathlive .fontsize-ensurer.reset-size5.size9,.ML__mathlive .sizing.reset-size5.size9{font-size:2.07em}.ML__mathlive .fontsize-ensurer.reset-size5.size10,.ML__mathlive .sizing.reset-size5.size10{font-size:2.49em}.ML__mathlive .fontsize-ensurer.reset-size6.size1,.ML__mathlive .sizing.reset-size6.size1{font-size:.41666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size2,.ML__mathlive .sizing.reset-size6.size2{font-size:.58333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size3,.ML__mathlive .sizing.reset-size6.size3{font-size:.66666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size4,.ML__mathlive .sizing.reset-size6.size4{font-size:.75em}.ML__mathlive .fontsize-ensurer.reset-size6.size5,.ML__mathlive .sizing.reset-size6.size5{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size6,.ML__mathlive .sizing.reset-size6.size6{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size6.size7,.ML__mathlive .sizing.reset-size6.size7{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size6.size8,.ML__mathlive .sizing.reset-size6.size8{font-size:1.44166667em}.ML__mathlive .fontsize-ensurer.reset-size6.size9,.ML__mathlive .sizing.reset-size6.size9{font-size:1.725em}.ML__mathlive .fontsize-ensurer.reset-size6.size10,.ML__mathlive .sizing.reset-size6.size10{font-size:2.075em}.ML__mathlive .fontsize-ensurer.reset-size7.size1,.ML__mathlive .sizing.reset-size7.size1{font-size:.34722222em}.ML__mathlive .fontsize-ensurer.reset-size7.size2,.ML__mathlive .sizing.reset-size7.size2{font-size:.48611111em}.ML__mathlive .fontsize-ensurer.reset-size7.size3,.ML__mathlive .sizing.reset-size7.size3{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size7.size4,.ML__mathlive .sizing.reset-size7.size4{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size7.size5,.ML__mathlive .sizing.reset-size7.size5{font-size:.69444444em}.ML__mathlive .fontsize-ensurer.reset-size7.size6,.ML__mathlive .sizing.reset-size7.size6{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size7.size7,.ML__mathlive .sizing.reset-size7.size7{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size7.size8,.ML__mathlive .sizing.reset-size7.size8{font-size:1.20138889em}.ML__mathlive .fontsize-ensurer.reset-size7.size9,.ML__mathlive .sizing.reset-size7.size9{font-size:1.4375em}.ML__mathlive .fontsize-ensurer.reset-size7.size10,.ML__mathlive .sizing.reset-size7.size10{font-size:1.72916667em}.ML__mathlive .fontsize-ensurer.reset-size8.size1,.ML__mathlive .sizing.reset-size8.size1{font-size:.28901734em}.ML__mathlive .fontsize-ensurer.reset-size8.size2,.ML__mathlive .sizing.reset-size8.size2{font-size:.40462428em}.ML__mathlive .fontsize-ensurer.reset-size8.size3,.ML__mathlive .sizing.reset-size8.size3{font-size:.46242775em}.ML__mathlive .fontsize-ensurer.reset-size8.size4,.ML__mathlive .sizing.reset-size8.size4{font-size:.52023121em}.ML__mathlive .fontsize-ensurer.reset-size8.size5,.ML__mathlive .sizing.reset-size8.size5{font-size:.57803468em}.ML__mathlive .fontsize-ensurer.reset-size8.size6,.ML__mathlive .sizing.reset-size8.size6{font-size:.69364162em}.ML__mathlive .fontsize-ensurer.reset-size8.size7,.ML__mathlive .sizing.reset-size8.size7{font-size:.83236994em}.ML__mathlive .fontsize-ensurer.reset-size8.size8,.ML__mathlive .sizing.reset-size8.size8{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size8.size9,.ML__mathlive .sizing.reset-size8.size9{font-size:1.19653179em}.ML__mathlive .fontsize-ensurer.reset-size8.size10,.ML__mathlive .sizing.reset-size8.size10{font-size:1.43930636em}.ML__mathlive .fontsize-ensurer.reset-size9.size1,.ML__mathlive .sizing.reset-size9.size1{font-size:.24154589em}.ML__mathlive .fontsize-ensurer.reset-size9.size2,.ML__mathlive .sizing.reset-size9.size2{font-size:.33816425em}.ML__mathlive .fontsize-ensurer.reset-size9.size3,.ML__mathlive .sizing.reset-size9.size3{font-size:.38647343em}.ML__mathlive .fontsize-ensurer.reset-size9.size4,.ML__mathlive .sizing.reset-size9.size4{font-size:.43478261em}.ML__mathlive .fontsize-ensurer.reset-size9.size5,.ML__mathlive .sizing.reset-size9.size5{font-size:.48309179em}.ML__mathlive .fontsize-ensurer.reset-size9.size6,.ML__mathlive .sizing.reset-size9.size6{font-size:.57971014em}.ML__mathlive .fontsize-ensurer.reset-size9.size7,.ML__mathlive .sizing.reset-size9.size7{font-size:.69565217em}.ML__mathlive .fontsize-ensurer.reset-size9.size8,.ML__mathlive .sizing.reset-size9.size8{font-size:.83574879em}.ML__mathlive .fontsize-ensurer.reset-size9.size9,.ML__mathlive .sizing.reset-size9.size9{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size9.size10,.ML__mathlive .sizing.reset-size9.size10{font-size:1.20289855em}.ML__mathlive .fontsize-ensurer.reset-size10.size1,.ML__mathlive .sizing.reset-size10.size1{font-size:.20080321em}.ML__mathlive .fontsize-ensurer.reset-size10.size2,.ML__mathlive .sizing.reset-size10.size2{font-size:.2811245em}.ML__mathlive .fontsize-ensurer.reset-size10.size3,.ML__mathlive .sizing.reset-size10.size3{font-size:.32128514em}.ML__mathlive .fontsize-ensurer.reset-size10.size4,.ML__mathlive .sizing.reset-size10.size4{font-size:.36144578em}.ML__mathlive .fontsize-ensurer.reset-size10.size5,.ML__mathlive .sizing.reset-size10.size5{font-size:.40160643em}.ML__mathlive .fontsize-ensurer.reset-size10.size6,.ML__mathlive .sizing.reset-size10.size6{font-size:.48192771em}.ML__mathlive .fontsize-ensurer.reset-size10.size7,.ML__mathlive .sizing.reset-size10.size7{font-size:.57831325em}.ML__mathlive .fontsize-ensurer.reset-size10.size8,.ML__mathlive .sizing.reset-size10.size8{font-size:.69477912em}.ML__mathlive .fontsize-ensurer.reset-size10.size9,.ML__mathlive .sizing.reset-size10.size9{font-size:.8313253em}.ML__mathlive .fontsize-ensurer.reset-size10.size10,.ML__mathlive .sizing.reset-size10.size10{font-size:1em}.ML__mathlive .delimsizing.size1{font-family:KaTeX_Size1}.ML__mathlive .delimsizing.size2{font-family:KaTeX_Size2}.ML__mathlive .delimsizing.size3{font-family:KaTeX_Size3}.ML__mathlive .delimsizing.size4{font-family:KaTeX_Size4}.ML__mathlive .delimsizing.mult .delim-size1{font-family:KaTeX_Size1;vertical-align:top}.ML__mathlive .delimsizing.mult .delim-size4{font-family:KaTeX_Size4;vertical-align:top}.ML__mathlive .nulldelimiter{width:.12em}.ML__mathlive .op-symbol{position:relative}.ML__mathlive .op-symbol.small-op{font-family:KaTeX_Size1}.ML__mathlive .op-symbol.large-op{font-family:KaTeX_Size2}.ML__mathlive .op-limits .vlist>span{text-align:center}.ML__mathlive .op-over-under{position:relative}.ML__mathlive .op-over-under>.vlist>span:first-child,.ML__mathlive .op-over-under>.vlist>span:last-child{text-align:center}.ML__mathlive .accent>.vlist>span{text-align:center}.ML__mathlive .accent .accent-body>span{font-family:KaTeX_Main;width:0}.ML__mathlive .accent .accent-body.accent-vec>span{position:relative;left:.326em}.ML__mathlive .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid}.ML__mathlive .mtable .arraycolsep{display:inline-block}.ML__mathlive .mtable .col-align-m>.vlist{text-align:center}.ML__mathlive .mtable .col-align-c>.vlist{text-align:center}.ML__mathlive .mtable .col-align-l>.vlist{text-align:left}.ML__mathlive .mtable .col-align-r>.vlist{text-align:right}.ML__error{background-image:radial-gradient(ellipse at center,#cc0041,transparent 70%);background-repeat:repeat-x;background-size:3px 3px;background-position:0 98%}.ML__composition{background:#fff1c2;color:#000;-webkit-text-decoration:underline var(--caret,hsl(var(--hue,212),40%,49%));text-decoration:underline var(--caret,hsl(var(--hue,212),40%,49%))}@media (prefers-color-scheme:dark){.ML__composition{background:#69571c;color:#fff}}.ML__placeholder{opacity:.7;padding-left:.4ex;padding-right:.4ex;padding-top:.4ex}')),this.stylesheets.push(zs(e,'@-webkit-keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}@keyframes ML__caret-blink{0%,to{opacity:1}50%{opacity:0}}.ML__caret:after{content:"";border:none;border-radius:2px;border-right:2px solid var(--caret,hsl(var(--hue,212),40%,49%));margin-right:-2px;position:relative;left:-1px;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__text-caret:after{content:"";border:none;border-radius:1px;border-right:1px solid var(--caret,hsl(var(--hue,212),40%,49%));margin-right:-1px;position:relative;left:0;-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__command-caret:after{content:"_";border:none;margin-right:-1ex;position:relative;color:var(--caret,hsl(var(--hue,212),40%,49%));-webkit-animation:ML__caret-blink 1.05s step-end infinite forwards;animation:ML__caret-blink 1.05s step-end infinite forwards}.ML__fieldcontainer{display:flex;flex-flow:row;justify-content:space-between;align-items:flex-end;min-height:39px;touch-action:none;width:100%;--hue:212;--secondary:hsl(var(--hue,212),19%,26%);--on-secondary:hsl(var(--hue,212),19%,26%)}.ML__fieldcontainer__field{align-self:center;position:relative;overflow:hidden;line-height:0;padding:2px;width:100%}.ML__virtual-keyboard-toggle{display:flex;align-self:center;align-items:center;flex-shrink:0;flex-direction:column;justify-content:center;width:34px;height:34px;padding:0;margin-right:4px;cursor:pointer;box-sizing:border-box;border-radius:50%;border:1px solid transparent;transition:background .2s cubic-bezier(.64,.09,.08,1);color:var(--primary,hsl(var(--hue,212),40%,50%));fill:currentColor;background:transparent}.ML__virtual-keyboard-toggle:hover{background:hsl(var(--hue,212),25%,35%);color:#fafafa;fill:currentColor;border-radius:50%;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)}.ML__popover{visibility:hidden;min-width:160px;background-color:rgba(97,97,97,.95);color:#fff;text-align:center;border-radius:6px;position:fixed;z-index:1;display:flex;flex-direction:column;justify-content:center;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);transition:all .2s cubic-bezier(.64,.09,.08,1)}.ML__popover:after{content:"";position:absolute;top:-5px;left:calc(50% - 3px);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;font-size:1rem;border-bottom:5px solid rgba(97,97,97,.9)}.ML__popover--reverse-direction:after{top:auto;bottom:-5px;border-top:5px solid rgba(97,97,97,.9);border-bottom:0}.ML__textarea__textarea{transform:scale(0);resize:none;outline:none;border:none;position:absolute;clip:rect(0 0 0 0);width:1px;height:1px;font-size:1em;font-family:KaTeX_Main}.ML__focused .ML__text{background:hsla(var(--hue,212),40%,50%,.1)}.ML__smart-fence__close{opacity:.5}.ML__selection{background:var(--highlight-inactive,#ccc);box-sizing:border-box}.ML__focused .ML__selection{background:var(--highlight,hsl(var(--hue,212),97%,85%))!important;color:var(--on-highlight)}.ML__contains-caret.ML__close,.ML__contains-caret.ML__open,.ML__contains-caret>.ML__close,.ML__contains-caret>.ML__open,.sqrt.ML__contains-caret>.sqrt-sign,.sqrt.ML__contains-caret>.vlist>span>.sqrt-line{color:var(--caret,hsl(var(--hue,212),40%,49%))}.ML__command{font-family:IBM Plex Mono,Source Code Pro,Consolas,Roboto Mono,Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Courier,monospace;letter-spacing:-1px;font-weight:400;line-height:1em;color:var(--primary,hsl(var(--hue,212),40%,50%))}:not(.ML__command)+.ML__command{margin-left:.25em}.ML__command+:not(.ML__command){padding-left:.25em}.ML__suggestion{opacity:.5}.ML__virtual-keyboard-toggle.pressed{background:hsla(0,0%,70%,.5)}.ML__virtual-keyboard-toggle:focus{outline:none;border-radius:50%;border:2px solid var(--primary,hsl(var(--hue,212),40%,50%))}.ML__virtual-keyboard-toggle.active,.ML__virtual-keyboard-toggle.active:hover{background:hsla(0,0%,70%,.5);color:#000;fill:currentColor}.ML__scroller{position:fixed;z-index:1;top:0;height:100vh;width:200px}[data-ML__tooltip]{position:relative}[data-ML__tooltip][data-placement=top]:after{top:inherit;bottom:100%}[data-ML__tooltip]:after{position:absolute;display:none;content:attr(data-ML__tooltip);top:110%;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:200px;padding:8px;background:#616161;color:#fff;text-align:center;z-index:2;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);border-radius:2px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-weight:400;font-size:12px;opacity:0;transform:scale(.5);transition:all .15s cubic-bezier(.4,0,1,1)}@media only screen and (max-width:767px){[data-ML__tooltip]:after{padding:8px 16px;font-size:14px}}:not(.tracking) [data-ML__tooltip]:hover{position:relative}:not(.tracking) [data-ML__tooltip]:hover:after{visibility:visible;display:inline-table;opacity:1;transform:scale(1)}[data-ML__tooltip][data-delay]:after{transition-delay:0s}[data-ML__tooltip][data-delay]:hover:after{transition-delay:1s}'));let o="";this.options.substituteTextArea?"string"==typeof this.options.substituteTextArea?o+=this.options.substituteTextArea:o+="":/android|ipad|ipod|iphone/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)?o+="\n \n \n ":o+=``,o+='',"manual"===this.options.virtualKeyboardMode?(o+=`
    `,this.options.virtualKeyboardToggleGlyph?o+=this.options.virtualKeyboardToggleGlyph:o+='',o+="
    "):o+="",o+="
    ",o+='\n
    \n \n \n
    \n ',this.element.innerHTML=this.options.createHTML(o);let i,a=0;i="function"==typeof this.options.substituteTextArea?this.options.substituteTextArea():this.element.children[a++].firstElementChild,this.field=this.element.children[a].children[0],this.field.addEventListener("wheel",(e=>{e.preventDefault(),e.stopPropagation();const t=void 0===e.deltaX?e.detail:-e.deltaX;isFinite(t)&&this.field.scroll({top:0,left:this.field.scrollLeft-5*t})}),{passive:!1}),this.virtualKeyboardToggle=this.element.children[a++].children[1],Jl(this,this.virtualKeyboardToggle,{default:"toggleVirtualKeyboard",alt:"toggleVirtualKeyboardAlt",shift:"toggleVirtualKeyboardShift"}),this.ariaLiveText=this.element.children[a].children[0],this.accessibleNode=this.element.children[a++].children[1],this.popover=Ul("mathlive-popover-panel","ML__popover"),this.stylesheets.push(zs(null,"div.ML__popover.is-visible{visibility:inherit;-webkit-animation:ML__fade-in .15s cubic-bezier(0,0,.2,1);animation:ML__fade-in .15s cubic-bezier(0,0,.2,1)}@-webkit-keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}@keyframes ML__fade-in{0%{opacity:0}to{opacity:1}}.ML__popover__content{border-radius:6px;padding:2px;cursor:pointer;min-height:100px;display:flex;flex-direction:column;justify-content:center;margin-left:8px;margin-right:8px}.ML__popover__content a{color:#5ea6fd;padding-top:.3em;margin-top:.4em;display:block}.ML__popover__content a:hover{color:#5ea6fd;text-decoration:underline}.ML__popover__content.active,.ML__popover__content.pressed,.ML__popover__content:hover{background:hsla(0,0%,100%,.1)}.ML__popover__command{font-size:1.6rem}.ML__popover__prev-shortcut{height:31px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:4px;padding-bottom:2px}.ML__popover__next-shortcut:hover,.ML__popover__prev-shortcut:hover{opacity:.3}.ML__popover__next-shortcut.active,.ML__popover__next-shortcut.pressed,.ML__popover__prev-shortcut.active,.ML__popover__prev-shortcut.pressed{opacity:1}.ML__popover__next-shortcut>span,.ML__popover__prev-shortcut>span{padding:5px;border-radius:50%;width:20px;height:20px;display:inline-block}.ML__popover__prev-shortcut>span>span{margin-top:-2px;display:block}.ML__popover__next-shortcut>span>span{margin-top:2px;display:block}.ML__popover__next-shortcut:hover>span,.ML__popover__prev-shortcut:hover>span{background:hsla(0,0%,100%,.1)}.ML__popover__next-shortcut{height:34px;opacity:.1;cursor:pointer;margin-left:8px;margin-right:8px;padding-top:2px;padding-bottom:4px}.ML__popover__shortcut{font-size:.8em;margin-top:.25em}.ML__popover__note,.ML__popover__shortcut{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;opacity:.7;padding-top:.25em}.ML__popover__note{font-size:.8rem;line-height:1em;padding-left:.5em;padding-right:.5em}.ML__shortcut-join{opacity:.5}")),this.keystrokeCaption=Ul("mathlive-keystroke-caption-panel","ML__keystroke-caption"),this.stylesheets.push(zs(null,".ML__keystroke-caption{visibility:hidden;background:var(--secondary);border-color:var(--secondary-border);box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);text-align:center;border-radius:6px;padding:16px;position:absolute;z-index:1;display:flex;flex-direction:row;justify-content:center;--keystroke:#fff;--on-keystroke:#555;--keystroke-border:#f7f7f7}@media (prefers-color-scheme:dark){body:not([theme=light]) .ML__keystroke-caption{--keystroke:hsl(var(--hue,212),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue,212),50%,25%)}}body[theme=dark] .ML__keystroke-caption{--keystroke:hsl(var(--hue,212),50%,30%);--on-keystroke:#fafafa;--keystroke-border:hsl(var(--hue,212),50%,25%)}.ML__keystroke-caption>span{min-width:14px;margin:0 8px 0 0;padding:4px;background-color:var(--keystroke);color:var(--on-keystroke);fill:currentColor;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:1em;border-radius:6px;border:2px solid var(--keystroke-border)}")),this.keystrokeCaptionVisible=!1,this.virtualKeyboardVisible=!1,this.keystrokeBuffer="",this.keystrokeBufferStates=[],this.keystrokeBufferResetTimer=null,this.suggestionIndex=0,this.mode=this.options.defaultMode,this.smartModeSuppressed=!1,this.style={},this.blurred=!0,Wl(this.element,"focus",this),Wl(this.element,"blur",this),this.keyboardDelegate=function(e,t){let n,r=null,o=null,i=!1,a=!1,s=!1;function l(e){clearTimeout(n),n=setTimeout((()=>{clearTimeout(n),e()}))}function c(){if(e.selectionStart!==e.selectionEnd)return;const n=e.value;e.value="",n.length>0&&t.typedText(n)}const d=e;return d.addEventListener("keydown",(n=>{i||"Process"===n.key||"CapsLock"===n.code||/(Control|Meta|Alt|Shift)(Left|Right)/.test(n.code)?r=null:(r=n,o=null,t.keystroke(Jc(n),n)||(r=null,e.value=""))}),!0),d.addEventListener("keypress",(e=>{i||i||(r&&o&&t.keystroke(Jc(r),r),o=e,l(c))}),!0),d.addEventListener("keyup",(()=>{i||r&&!o&&c()}),!0),d.addEventListener("paste",(n=>{e.focus(),e.value="",t.paste(n)}),!0),d.addEventListener("cut",(()=>{t.cut()}),!0),d.addEventListener("copy",(e=>{t.copy(e)}),!0),d.addEventListener("blur",(e=>{s||a||(s=!0,r=null,o=null,t.blur&&t.blur(),s=!1)}),!0),d.addEventListener("focus",(e=>{s||a||(a=!0,t.focus&&t.focus(),a=!1)}),!0),d.addEventListener("compositionstart",(n=>{i=!0,e.value="",t.compositionStart&&t.compositionStart(n.data)}),!0),d.addEventListener("compositionupdate",(e=>{i&&t.compositionUpdate&&t.compositionUpdate(e.data)}),!0),d.addEventListener("compositionend",(n=>{e.value="",i&&(i=!1,t.compositionEnd&&t.compositionEnd(n.data))}),!0),d.addEventListener("input",(e=>{if(!i&&"insertCompositionText"!==e.inputType)return"insertFromPaste"===e.inputType?(e.preventDefault(),void e.stopPropagation()):void l(c)})),{cancelComposition:()=>{const n=t.blur,r=t.focus;t.blur=null,t.focus=null,e.blur(),e.focus(),t.blur=n,t.focus=r},blur:()=>{"function"==typeof e.blur&&e.blur()},focus:()=>{"function"==typeof e.blur&&e.focus()},hasFocus:()=>Qc(document)===e,setValue:t=>{t?(e.value=t,Qc(document)===e&&e.select&&e.select()):(e.value="",e.setAttribute("aria-label",""))},setAriaLabel:t=>{e.setAttribute("aria-label","after: "+t)},moveTo:(t,n)=>{e.style.top=n+"px",e.style.left=t+"px"}}}(i,{typedText:e=>zd(this,e),cut:()=>{return e=this,setTimeout(function(){e.$clearSelection(),Ec(e)}.bind(e),0),!0;var e},copy:e=>{return n=e,kl((t=this).model)?(n.clipboardData.setData("text/plain","$$"+t.getValue("latex-expanded")+"$$"),n.clipboardData.setData("application/json",t.getValue("json")),n.clipboardData.setData("application/xml",t.getValue("mathML"))):(n.clipboardData.setData("text/plain","$$"+t.getValue(t.selection,"latex-expanded")+"$$"),n.clipboardData.setData("application/json",t.getValue(t.selection,"json")),n.clipboardData.setData("application/xml",t.getValue(t.selection,"mathML"))),void n.preventDefault();var t,n},paste:e=>function(e,t){let n="";const r=t.clipboardData.getData("application/json");if(r)try{n=function(e,t){return $u("string"==typeof e?JSON.parse(e):e,t)}(r,{})}catch(e){n=""}return n||(n=t.clipboardData.getData("text/plain")),n&&($c(e.model,n,{smartFence:e.options.smartFence,mode:"math"}),Ec(e),t.preventDefault(),t.stopPropagation()),!0}(this,e),keystroke:(e,t)=>Ed(this,e,t),focus:()=>this.onFocus(),blur:()=>this.onBlur(),compositionStart:e=>this.onCompositionStart(e),compositionUpdate:e=>this.onCompositionUpdate(e),compositionEnd:e=>this.onCompositionEnd(e)}),window.PointerEvent?Wl(this.field,"pointerdown",this):Wl(this.field,"touchstart:active mousedown",this),Wl(window,"resize",this),this.model=new Zc({mode:this.options.defaultMode,macros:this.options.macros,removeExtraneousParentheses:this.options.removeExtraneousParentheses},{onContentDidChange:e=>this.options.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.options.onContentWillChange(this),onSelectionWillChange:()=>this.options.onSelectionWillChange(this),onError:this.options.onError},{announce:(e,t,n,r)=>{var o,i;return null===(i=(o=this.options).onAnnounce)||void 0===i?void 0:i.call(o,this,t,n,r)},moveOut:(e,t)=>this.options.onMoveOutOf(this,t),tabOut:(e,t)=>this.options.onTabOutOf(this,t)},this),this.undoManager=new td(this.model),$c(this.model,r,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:!0,macros:this.options.macros}),this.undoManager.startRecording(),this.undoManager.snapshot(this.options),this.model.setListeners({onContentDidChange:e=>this.options.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.options.onContentWillChange(this),onSelectionWillChange:()=>this.options.onSelectionWillChange(this),onError:this.options.onError}),this.model.setHooks({announce:(e,t,n,r)=>{var o,i;return null===(i=(o=this.options).onAnnounce)||void 0===i?void 0:i.call(o,this,t,n,r)},moveOut:(e,t)=>this.options.onMoveOutOf(this,t),tabOut:(e,t)=>this.options.onTabOutOf(this,t)}),this.options.locale.startsWith(Bl().locale)||Rl(this.options.locale),this.keybindings=Hl(this.options.keybindings,(e=>{"function"==typeof this.options.onError&&this.options.onError({code:"invalid-keybinding",arg:e.join("\n")}),console.log(e.join("\n"))})),Ec(this)}$setConfig(e){qu("$setConfig"),this.setOptions(e)}setOptions(e){this.options=xd(this.options,e),this.model.setListeners({onContentDidChange:e=>this.options.onContentDidChange(this),onSelectionDidChange:e=>this._onSelectionDidChange(),onContentWillChange:()=>this.options.onContentWillChange(this),onSelectionWillChange:()=>this.options.onSelectionWillChange(this),onError:this.options.onError}),this.model.setHooks({announce:(e,t,n,r)=>{var o,i;return null===(i=(o=this.options).onAnnounce)||void 0===i?void 0:i.call(o,this,t,n,r)},moveOut:(e,t)=>this.options.onMoveOutOf(this,t),tabOut:(e,t)=>this.options.onTabOutOf(this,t)}),this.options.locale.startsWith(Bl().locale)||Rl(this.options.locale),this.keybindings=Hl(this.options.keybindings,(e=>{"function"==typeof this.options.onError&&this.options.onError({code:"invalid-keybinding",arg:e.join("\n")}),console.log(e.join("\n"))})),this.options.readOnly||this.onBlur();const t=this.model.root.toLatex();$c(this.model,t,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:!0,macros:this.options.macros}),Ec(this)}getConfig(e){return qu("$getConfig"),wd(this.options,e)}getOptions(e){return wd(this.options,e)}getOption(e){return wd(this.options,e)}handleEvent(e){switch(e.type){case"focus":this.eventHandlingInProgress||(this.eventHandlingInProgress="focus",this.onFocus(),this.eventHandlingInProgress="");break;case"blur":this.eventHandlingInProgress||(this.eventHandlingInProgress="blur",this.onBlur(),this.eventHandlingInProgress="");break;case"touchstart":case"mousedown":case"pointerdown":!function(e,t){const n=e;let r,o=!1,i=!1,a=!1;if(1!==t.buttons&&0!==t.buttons)return;let s=!1,l=!1;const c=t.touches?t.touches[0].clientX:t.clientX,d=t.touches?t.touches[0].clientY:t.clientY,u=Date.now(),p=setInterval((()=>{s?n.field.scroll({top:0,left:n.field.scrollLeft-16}):l&&n.field.scroll({top:0,left:n.field.scrollLeft+16})}),32);function h(e){window.PointerEvent?(Vl(n.field,"pointermove",f),Vl(n.field,"pointerup pointercancel",h),n.field.releasePointerCapture(e.pointerId)):(Vl(n.field,"touchmove",f),Vl(n.field,"touchcancel touchend",h),Vl(window,"mousemove",f),Vl(window,"mouseup blur",h)),o=!1,clearInterval(p),e.preventDefault(),e.stopPropagation()}function f(t){const o=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,p="touch"===t.pointerType?20:5;if(Date.now()h.right,s=o=m.left&&c<=m.right&&d>=m.top&&d<=m.bottom){e.hasFocus()||(a=!0,e.keyboardDelegate.focus()),e.resetKeystrokeBuffer(),e.smartModeSuppressed=!1;const s=e.field.querySelector(".ML__mathlive").getBoundingClientRect();r=c>s.right?[{relation:"body",offset:e.model.root.body.length-1}]:Dd(e,c,d,{bias:0}),r&&(e.element.classList.add("tracking"),t.shiftKey?(zl(e.model,e.model.path,r),r=Is(e.model.path),r[r.length-1].offset-=1):il(e.model,r,0),a=!0,e.style={},3===t.detail||Td>2?(h(t),3!==t.detail&&3!==Td||wl(e.model)):o||(o=!0,window.PointerEvent?(Wl(n.field,"pointermove",f),Wl(n.field,"pointerup pointercancel",h),n.field.setPointerCapture(t.pointerId)):(Wl(window,"blur",h),t.touches?(Wl(t.target,"touchmove",f),Wl(t.target,"touchcancel touchend",h)):(Wl(window,"mousemove",f),Wl(window,"mouseup",h))),2!==t.detail&&2!==Td||(i=!0,xl(e.model))))}else Od=null;a&&Ec(e),t.preventDefault()}(this,e);break;case"resize":this.resizeTimer&&window.cancelAnimationFrame(this.resizeTimer),this.resizeTimer=window.requestAnimationFrame((()=>Gl(this)&&this.onResize()));break;default:console.warn("Unexpected event type",e.type)}}$revertToOriginalContent(){qu("$revertToOriginalContent"),this.dispose(),this.element.innerHTML=this.options.createHTML(this.originalContent)}dispose(){this.element.innerHTML="$$"+this.getValue()+"$$",delete this.element.mathfield,delete this.accessibleNode,delete this.ariaLiveText,delete this.field,delete this.keyboardDelegate,this.virtualKeyboardToggle.remove(),delete this.virtualKeyboardToggle,Zl(this.popover),delete this.popover,Zl(this.keystrokeCaption),delete this.keystrokeCaption,this.virtualKeyboard&&(this.virtualKeyboard.dispose(),delete this.virtualKeyboard),Vl(this.element,"pointerdown",this),Vl(this.element,"touchstart:active mousedown",this),Vl(this.element,"focus",this),Vl(this.element,"blur",this),Vl(window,"resize",this),delete this.element,this.stylesheets.forEach((e=>e.release()))}resetKeystrokeBuffer(e){(e=null!=e?e:{defer:!1}).defer?this.options.inlineShortcutTimeout&&(this.keystrokeBufferResetTimer=setTimeout((()=>{this.resetKeystrokeBuffer()}),this.options.inlineShortcutTimeout)):(this.keystrokeBuffer="",this.keystrokeBufferStates=[],clearTimeout(this.keystrokeBufferResetTimer))}_onSelectionDidChange(){!function(e){const t=cl(e);if(t){const n=e.siblings(),r=e.anchorOffset()+1;for(let e=t.start;e{zc(this);const e=Xl(this.field);e&&this.keyboardDelegate.moveTo(e.x,e.y)}))}onCompositionUpdate(e){!function(e,t){const n=ol(e);if("composition"===n.type)n.body=t;else{const r=n.caret;n.caret="";const o=new gs(n.mode,"composition",t);o.caret=r,e.siblings().splice(e.anchorOffset()+1,0,o),e.path[e.path.length-1].offset+=1}}(this.model,e),Ec(this)}onCompositionEnd(e){var t;"composition"===ol(t=this.model).type&&(t.siblings().splice(t.anchorOffset(),1),t.path[t.path.length-1].offset-=1),zd(this,e,{simulateKeystroke:!0})}onResize(){this.element.classList.remove("ML__isNarrowWidth","ML__isWideWidth","ML__isExtendedWidth"),window.innerWidth>=1024?this.element.classList.add("ML__isExtendedWidth"):window.innerWidth>=768?this.element.classList.add("ML__isWideWidth"):this.element.classList.add("ML__isNarrowWidth"),tc(this)}$perform(e){return qu("$perform"),this.executeCommand(e)}executeCommand(e){return function(e,t){var n;if(!t)return!1;let r,o=[],i=!1,a=!1;if(si(t)?(r=t[0],o=t.slice(1)):r=t,r=r.replace(/-\w/g,(e=>e[1].toUpperCase())),"model"===(null===(n=Cc[r])||void 0===n?void 0:n.target)){if(/^(delete|transpose|add)/.test(r)&&"deletePreviousChar"!==r&&e.resetKeystrokeBuffer(),/^(delete|transpose|add)/.test(r)&&"command"!==e.mode&&(e.popUndoStack(),e.snapshot()),Cc[r].fn(e.model,...o),/^(delete|transpose|add)/.test(r)&&"command"!==e.mode&&e.snapshot(),/^(delete)/.test(r)&&"command"===e.mode){const t=_a(oc(e.model));0===t.length?rc(e):ec(e,t[0].match,t.length>1)}a=!0,i=!0}else{if(!Cc[r])throw Error('Unknown command "'+r+'"');a=Cc[r].fn(e,...o),i=!0}return kl(e.model)&&!/^(transpose|paste|complete|((moveToNextChar|moveToPreviousChar|extend).*))_$/.test(r)||(e.resetKeystrokeBuffer(),e.style={}),a&&Ec(e),i}(this,e)}atomToString(e,t){let n="";if("latex"===(t=t||"latex")||"latex-expanded"===t)n=e.toLatex("latex-expanded"===t);else if("mathML"===t)n=Mc(e,this.options);else if("spoken"===t)n=fd(e,this.options);else if("spoken-text"===t){const t=this.options.textToSpeechMarkup;this.options.textToSpeechMarkup="",n=fd(e,this.options),this.options.textToSpeechMarkup=t}else if("spoken-ssml"===t||"spoken-ssml-withHighlighting"===t){const t=this.options.textToSpeechMarkup;this.options.textToSpeechMarkup="ssml",n=fd(e,this.options),this.options.textToSpeechMarkup=t}else if("json"===t){console.log("deprecated format. Use MathJSON");const t=Iu(e);n=JSON.stringify(t)}else if("json-2"===t){console.log("deprecated format. Use MathJSON");const t=Iu(e);n=JSON.stringify(t,null,2)}else"ASCIIMath"===t?n=od(e):console.warn("Unknown format :",t);return n}get lastPosition(){return this.model.lastPosition}get selection(){return this.model.selection}set selection(e){this.model.selection=e}$text(e){return this.atomToString(this.model.root,e)}getValue(e,t,n){if(void 0===e)return this.atomToString(this.model.root,"latex");let r,o;if("string"==typeof e)return r=e,this.atomToString(this.model.root,r);"number"!=typeof e||"number"!=typeof t&&void 0!==t?Array.isArray(e)?(o=e,r=t):(o=[e],r=t):(o=[{start:e,end:null!=t?t:-1}],r=null!=n?n:"latex");const i=new Hc(this.model.root);return o.map((e=>{let t="";if(!(e=Ts(i,e)).collapsed){const n=i.at(e.start).depth;for(let o=e.start+1;o<=e.end;o++)i.at(o).depth===n&&(t+=this.atomToString(i.at(o).atom,r))}return t})).join("")}setValue(e,t){e!==this.getValue()&&(t=null!=t?t:{mode:"math"},$c(this.model,e,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",mode:"math",suppressChangeNotifications:t.suppressChangeNotifications,macros:this.options.macros}),this.undoManager.snapshot(this.options),Ec(this))}find(e){const t=[],n=new Hc(this.model.root),r=n.lastPosition;for(let o=0;on.right&&this.field.scroll({top:0,left:e-n.right+this.field.scrollLeft+20,behavior:"smooth"})}}$insert(e,t){return qu("$insert"),this.insert(e,t)}insert(e,t){if("string"==typeof e&&e.length>0){if((t=null!=t?t:{mode:"math"}).focus&&this.focus(),t.feedback&&(this.options.keypressVibration&&(null===navigator||void 0===navigator?void 0:navigator.vibrate)&&navigator.vibrate(3),this.keypressSound&&(this.keypressSound.load(),this.keypressSound.play())),"\\\\"===e)Dc(this.model);else if("&"===e)Pc(this.model);else{const n=this.style;$c(this.model,e,{mode:this.mode,style:sl(this.model),...t}),t.resetStyle&&(this.style=n)}return this.undoManager.snapshot(this.options),Ec(this),!0}return!1}switchMode(e,t="",n=""){this.mode!==e&&(this.resetKeystrokeBuffer(),this.smartModeSuppressed=/text|math/.test(this.mode)&&/text|math/.test(e),t&&this.insert(t,{format:"latex",mode:{math:"text",text:"math"}[e]}),ic(this.model,!1),"command"===e?(Ls(this.model),rc(this),this.suggestionIndex=0,this.virtualKeyboardVisible&&Ud(this,"lower-command"),$c(this.model,"",{mode:"math"})):this.mode=e,n&&this.insert(n,{format:"latex",mode:e}),"function"==typeof this.options.onModeChange&&this.options.onModeChange(this,this.mode),Ec(this))}$hasFocus(){return qu("$hasFocus"),this.hasFocus()}hasFocus(){return document.hasFocus()&&this.keyboardDelegate.hasFocus()}focus(){this.hasFocus()||(this.keyboardDelegate.focus(),this.model.announce("line"))}blur(){this.hasFocus()&&this.keyboardDelegate.blur()}$focus(){return qu("$focus"),this.focus()}$blur(){return qu("$blur"),this.blur()}$select(){wl(this.model)}select(){wl(this.model)}$clearSelection(){qu("$clearSelection"),Nc(this.model)}applyStyle(e){Bc(this.model,e)}$applyStyle(e){Bc(this.model,e)}$keystroke(e,t){return qu("$keystroke"),Ed(this,e,t)}$typedText(e){qu("$typedText"),zd(this,e)}getCaretPoint(){const e=Xl(this.field);return e?{x:e.x,y:e.y}:null}setCaretPoint(e,t){const n=this.model.clone(),r=Dd(this,e,t,{bias:0}),o=il(this.model,r,0);return this.model.announce("move",n),Ec(this),o}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(){this.undoManager.snapshot({...this.options,onUndoStateDidChange:(e,t)=>{Vd(this),this.options.onUndoStateDidChange(e,t)}})}snapshotAndCoalesce(){this.undoManager.snapshotAndCoalesce({...this.options,onUndoStateDidChange:(e,t)=>{Vd(this),this.options.onUndoStateDidChange(e,t)}})}getUndoRecord(){return this.undoManager.save()}restoreToUndoRecord(e){this.undoManager.restore(e,{...this.options,suppressChangeNotifications:!0})}undo(){return this.undoManager.undo({...this.options,onUndoStateDidChange:(e,t)=>{Vd(this),this.options.onUndoStateDidChange(e,t)}})}redo(){return this.undoManager.redo({...this.options,onUndoStateDidChange:(e,t)=>{Vd(this),this.options.onUndoStateDidChange(e,t)}})}}function qu(e){console.warn(`Method "${e}" is deprecated`)}const Fu=1200,Hu=3e3,Wu=4e3;function Vu(e,t,n=3e3,r="$0"){t.forEach((t=>{ta[t]&&(ta[t].frequency=n,ta[t].category=e,ta[t].template=r.replace(/\$0/g,t)),ra[t]&&(ra[t]={...ra[t],frequency:n,category:e,template:r.replace(/\$0/g,t)})}))}function Uu(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Zu(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var Gu;Vu("Trigonometry",["\\cos","\\sin","\\tan"],Wu),Vu("Trigonometry",["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\lg","\\lb","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th"],2e3),Vu("Functions",["\\ln","\\log","\\exp","\\lim"],Wu),Vu("Functions",["\\dim","\\ker","\\deg","\\det","\\mod","\\min","\\max"],Hu),Vu("Functions",["\\hom"],Fu),Vu("Decoration",["\\rule"],200,"$0{2em}{1em}"),Vu("Decoration",["\\color","\\textcolor"],200,"{$0{m0}A}{$0{m1}B}{$0{m2}C }{$0{m3}a}{$0{m4}b}{$0{m5}c}{$0{m6}8}"),Vu("Decoration",["\\overline","\\underline"],Hu,"$0{\\placeholder{}}"),Vu("Decoration",["\\enclose"],Fu,'\\enclose{updiagonalstrike,roundedbox}[1px solid red, mathbackground="#fbc0bd"]{x=0}'),Vu("Decoration",["\\fcolorbox"],Fu,'\\fcolorbox{#cd0030}{#ffd400}{\\unicode{"2B1A}}'),Vu("Decoration",["\\colorbox"],Fu,'\\colorbox{#fbc0bd}{\\unicode{"2B1A}}'),Vu("Decoration",["\\boxed","\\cancel","\\bcancel","\\xcancel"],Fu,"$0{\\placeholder{}}"),Vu("Decoration",["\\bbox"],Fu,'\\bbox[#ffd400, solid 2px #ffd400]{\\unicode{"2B1A}}'),Vu("Styling",["\\mathbb"],Wu,"$0{Don Knuth}"),Vu("Styling",["\\textbf","\\textup","\\textit","\\textrm","\\textsf","\\texttt","\\textnormal","\\textmd","\\textsl","\\textsc","\\mathsf","\\mathtt","\\mathrm","\\mathfrak","\\mathcal","\\mathscr","\\mathbf","\\mathmd","\\mathit","\\text","\\mbox","\\Bbb","\\bold","\\bm","\\boldsymbol"],Hu,"$0{Don Knuth}"),Vu("Styling",["\\frak","\\tt","\\bf","\\it","\\rmfamily","\\sffamily","\\ttfamily","\\class","\\cssId"],Fu,"{$0 Don Knuth}"),Vu("Styling",["\\bfseries","\\mdseries","\\upshape","\\slshape","\\scshape"],Fu,"\\text{$0 Don Knuth}"),Vu("Styling",["\\class","\\cssId"],Fu,"$0{testIdentifier}{Don Knuth}"),Vu("Styling",["\\fontseries"],Fu,"\\text{$0{b}Don Knuth}"),Vu("Styling",["\\fontfamily"],Fu,"\\text{$0{cmtt}Don Knuth}"),Vu("Styling",["\\fontshape"],Fu,"\\text{$0{sc}Don Knuth}"),Vu("Styling",["\\selectfont"],Fu,"\\text{$0}"),Vu("Styling",["\\emph"],Fu,"Don$0{Knuth}"),Vu("Styling",["\\em"],Fu,"Don{$0 Knuth}"),Vu("Layout",["\\mathop","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathord","\\mathinner","\\operatorname","\\operatorname*"],Fu,"x=$0{arg}=0"),Vu("Layout",["\\middle"],Fu,"\\left\\{x$0|x>0\\right\\}"),Vu("Layout",["\\overset","\\underset","\\stackrel","\\stackbin"],Fu,"$0{arg}{x=0}"),Vu("Layout",["\\rlap","\\mathrlap"],Fu,"$0{/}0"),Vu("Layout",["\\llap","\\mathllap"],Fu,"o$0{/}"),Vu("Fractions",["\\frac"],Wu,"$0{\\placeholder{}}{\\placeholder{}}"),Vu("Fractions",["\\binom","\\dfrac","\\tfrac","\\dbinom","\\tbinom","\\pdiff","\\cfrac"],Fu,"$0{\\placeholder{}}{\\placeholder{}}"),Vu("Fractions",["\\over","\\atop","\\choose"],Fu,'\\unicode{"2B1A} $0 \\unicode{"2B1A}'),Vu("Fractions",["\\overwithdelims","\\atopwithdelims"],Fu,'{\\unicode{"2B1A} $0{\\lbrace}{\\rbrace} \\unicode{"2B1A}}'),Vu("Extensible Operators",["\\sum","\\prod","\\bigcap","\\bigcup","\\int"],Wu),Vu("Extensible Operators",["\\bigoplus","\\smallint","\\iint","\\oint"],Hu),Vu("Extensible Operators",["\\bigwedge","\\bigvee","\\coprod","\\bigsqcup","\\bigotimes","\\bigodot","\\biguplus","\\intop","\\sqcup","\\sqcap","\\uplus","\\wr","\\Cap","\\Cup","\\doublecap","\\doublecup","\\amalg","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"],Fu),Vu("Accents",["\\vec"],Wu),Vu("Accents",["\\bar","\\ddot","\\acute","\\tilde","\\check"],Hu,"$0{\\placeholder{}}"),Vu("Accents",["\\^","\\`","\\'"],Fu,"$0{e}"),Vu("Accents",["\\c"],Fu,"$0{c}"),Vu("Accents",["\\~"],Fu,"$0{n}"),Vu("Accents",["\\mathring","\\hat","\\dot","\\breve","\\grave"],Fu,"$0{\\placeholder{}}"),Vu("Extensible Symbols",["\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftharpoon","\\overrightharpoon","\\overleftrightarrow","\\overbrace","\\overlinesegment","\\overgroup","\\widehat","\\widecheck","\\widetilde"],Hu,"$0{ABC}"),Vu("Extensible Symbols",["\\underrightarrow","\\underleftarrow","\\underleftrightarrow","\\underbrace","\\underlinesegment","\\undergroup","\\utilde"],Hu,"$0{ABC}"),Vu("Sizing",["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Fu,"$0{x=0}"),Vu("Sizing",["\\big","\\Big","\\bigg","\\Bigg"],Fu,"$0($0)"),Vu("Sizing",["\\bigl","\\Bigl","\\biggl","\\Biggl"],Fu,"$0("),Vu("Sizing",["\\bigr","\\Bigr","\\biggr","\\Biggr"],Fu,"$0)"),Vu("Sizing",["\\bigm","\\Bigm","\\biggm","\\Biggm"],Fu,"$0|"),Vu("Letterlike Symbols",["\\nabla","\\partial","\\doubleStruckCapitalN","\\N","\\doubleStruckCapitalR","\\R","\\doubleStruckCapitalQ","\\Q","\\doubleStruckCapitalC","\\C","\\doubleStruckCapitalZ","\\Z","\\exponentialE","\\forall","\\exists","\\nexists","\\$","\\%","\\And","\\degree"],Wu),Vu("Letterlike Symbols",["\\doubleStruckCapitalP","\\P","\\ell","\\hbar","\\hslash","\\imath","\\jmath","\\imaginaryI","\\imaginaryJ","\\differentialD","\\rd","\\capitalDifferentialD","\\rD","\\differencedelta","\\mid","@","\\Re","\\Im"],Hu),Vu("Letterlike Symbols",["\\top","\\bot","\\scriptCapitalE","\\scriptCapitalH","\\scriptCapitalL","\\gothicCapitalC","\\gothicCapitalH","\\gothicCapitalI","\\gothicCapitalR","\\Bbbk","\\Finv","\\Game","\\wp","\\eth","\\mho","\\pounds","\\yen","\\euro"],Fu),Vu("Crosses",["\\dagger","\\dag"],Wu),Vu("Crosses",["\\ddag","\\ddagger","\\maltese","\\textdagger","\\textdaggerdbl"],Fu),Vu("Various",["\\checkmark","\\diagup","\\diagdown","\\angle","\\measuredangle","\\sphericalangle","\\prime","\\doubleprime","\\backprime","\\backdoubleprime","\\sharp","\\flat","\\natural","\\&","\\#","\\clubsuit","\\spadesuit","\\diamondsuit","\\heartsuit","\\backslash","\\infty","/","\\_","\\/","|","'"],Fu),Vu("Various",["\\unicode"],Fu,'$0{"2B1A}'),Vu("Arrows",["\\longrightarrow","\\rightarrow","\\Longrightarrow","\\Rightarrow"],Wu),Vu("Arrows",["\\longmapsto","\\mapsto","\\Longleftrightarrow","\\rightleftarrows","\\leftarrow","\\curvearrowleft","\\uparrow","\\downarrow","\\hookrightarrow","\\rightharpoonup","\\rightleftharpoons"],Hu),Vu("Arrows",["\\Leftarrow","\\longleftrightarrow","\\longleftarrow","\\Longleftarrow","\\searrow","\\nearrow","\\swarrow","\\nwarrow","\\Uparrow","\\Downarrow","\\updownarrow","\\Updownarrow","\\hookleftarrow","\\leftharpoonup","\\leftharpoondown","\\rightharpoondown","\\leftrightarrows","\\dashrightarrow","\\dashleftarrow","\\leftleftarrows","\\Lleftarrow","\\twoheadleftarrow","\\leftarrowtail","\\looparrowleft","\\leftrightharpoons","\\circlearrowleft","\\Lsh","\\upuparrows","\\downharpoonleft","\\multimap","\\leftrightsquigarrow","\\twoheadrightarrow","\\rightarrowtail","\\looparrowright","\\curvearrowright","\\circlearrowright","\\Rsh","\\downdownarrows","\\upharpoonright","\\downharpoonright","\\rightsquigarrow","\\leadsto","\\Rrightarrow","\\restriction"],Fu),Vu("Arrows",["\\upharpoonleft","\\rightrightarrows"],0),Vu("Negated Arrows",["\\nrightarrow","\\nRightarrow","\\nleftrightarrow","\\nLeftrightarrow","\\nleftarrow","\\nLeftarrow"],Fu),Vu("Extensible Symbols",["\\xrightarrow","\\xleftarrow","\\xRightarrow","\\xLeftarrow","\\xleftharpoonup","\\xleftharpoondown","\\xrightharpoonup","\\xrightharpoondown","\\xlongequal","\\xtwoheadleftarrow","\\xtwoheadrightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xrightleftharpoons","\\xleftrightharpoons","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium"],Fu,"$0[below]{above}=0"),Vu("Negated Relations",["\\nless","\\nleqslant","\\lneq","\\lneqq","\\nleqq","\\unlhd","\\unrhd","\\lvertneqq","\\lnsim","\\lnapprox","\\nprec","\\npreceq","\\precnsim","\\precnapprox","\\nsim","\\nshortmid","\\nmid","\\nvdash","\\nvDash","\\ngtr","\\ngeqslant","\\ngeqq","\\gneq","\\gneqq","\\gvertneqq","\\gnsim","\\nsucc","\\succnsim","\\ncong","\\nshortparallel","\\nparallel","\\nVDash","\\nVdash","\\precneqq","\\succneqq","\\gnapprox","\\succnapprox","\\nsucceq"],Fu),Vu("Hebrew",["\\aleph","\\beth","\\daleth","\\gimel"],Fu),Vu("Fences",["\\lbrace","\\rbrace","\\vert","\\Vert","\\{","\\}","(",")","[","]"],Wu),Vu("Fences",["\\langle","\\rangle","\\lfloor","\\rfloor","\\lceil","\\rceil","\\mvert","\\|","\\mVert"],Hu),Vu("Fences",["\\lvert","\\rvert","\\lVert","\\rVert","\\lbrack","\\rbrack","\\ulcorner","\\urcorner","\\llcorner","\\lrcorner","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache"],Fu),Vu("Relations",["=","\\ne","\\neq","<",">","\\leqslant","\\geqslant","\\approx"],Wu),Vu("Relations",["\\lt","\\gt","\\le","\\ge","\\leq","\\geq","\\gg","\\cong","\\equiv","\\prec","\\preceq","\\succ","\\perp","\\parallel","\\propto","\\smile","\\frown","\\sim","\\gtrsim"],Hu),Vu("Relations",["\\coloneq","\\succeq","\\approxeq","\\thickapprox","\\lessapprox","\\gtrapprox","\\precapprox","\\succapprox","\\thicksim","\\succsim","\\precsim","\\backsim","\\eqsim","\\backsimeq","\\simeq","\\lesssim","\\nleq","\\ngeq","\\smallsmile","\\smallfrown","\\bowtie","\\asymp","\\leqq","\\eqslantless","\\ll","\\lll","\\lessgtr","\\lesseqgtr","\\lesseqqgtr","\\risingdotseq","\\fallingdotseq","\\preccurlyeq","\\curlyeqprec","\\vDash","\\Vvdash","\\bumpeq","\\Bumpeq","\\geqq","\\eqslantgtr","\\ggg","\\gtrless","\\gtreqless","\\gtreqqless","\\succcurlyeq","\\curlyeqsucc","\\Vdash","\\shortmid","\\shortparallel","\\between","\\pitchfork","\\varpropto","\\backepsilon","\\llless","\\gggtr","\\lhd","\\rhd","\\Join","\\doteq","\\doteqdot","\\Doteq","\\eqcirc","\\circeq","\\lessdot","\\gtrdot","\\measeq","\\eqdef","\\questeq"],Fu),Vu("Logic",["\\leftrightarrow","\\Leftrightarrow","\\to"],Wu),Vu("Logic",["\\models","\\vdash"],Hu),Vu("Logic",["\\therefore","\\because","\\implies","\\gets","\\dashv","\\impliedby","\\biconditional","\\roundimplies"],Fu),Vu("Operators",["+","-","*","\\cdot"],Wu),Vu("Operators",["\\sqrt"],Wu,"$0{\\placeholder{}}"),Vu("Operators",["\\pm","\\mp","\\times","\\div","\\surd"],Hu),Vu("Operators",["\\ltimes","\\rtimes","\\leftthreetimes","\\rightthreetimes","\\intercal","\\dotplus","\\centerdot","\\doublebarwedge","\\divideontimes","\\divides"],Fu),Vu("Logic",["\\wedge","\\vee","\\neg"],Wu),Vu("Logic",["\\lnot"],Hu),Vu("Logic",["\\land","\\lor","\\barwedge","\\veebar","\\nor","\\curlywedge","\\curlyvee"],Fu),Vu("Greek",["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\varepsilon","\\zeta","\\eta","\\theta","\\vartheta","\\iota","\\kappa","\\varkappa","\\lambda","\\mu","\\nu","\\xi","\\pi","\\varpi","\\rho","\\varrho","\\sigma","\\varsigma","\\tau","\\phi","\\varphi","\\upsilon","\\chi","\\psi","\\omega","\\Gamma","\\Delta","\\Theta","\\Lambda","\\Xi","\\Pi","\\Sigma","\\Upsilon","\\Phi","\\Psi","\\Omega","\\digamma","\\omicron"],Hu),Vu("Sets",["\\emptyset","\\varnothing","\\cap","\\cup","\\in","\\notin","\\subset","\\supset","\\subseteq","\\supseteq","\\sqsubseteq"],Wu),Vu("Sets",["\\setminus","\\not","\\ni","\\sqsupseteq","\\nsupseteqq","\\supsetneq","\\varsupsetneq","\\supsetneqq","\\varsupsetneqq"],Hu),Vu("Sets",["\\smallsetminus","\\complement","\\owns","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\varsubsetneqq","\\nsubset","\\nsupset","\\nsubseteq","\\nsupseteq","\\nsubseteqq","\\subseteqq","\\Subset","\\sqsubset","\\supseteqq","\\Supset","\\sqsupset"],Fu),Vu("Spacing",["\\space, \\quad","\\qquad"],Hu,'\\unicode{"203A}$0\\unicode{"2039}'),Vu("Spacing",["\\!","\\,","\\:","\\;","\\enskip","\\enspace"],Fu,'\\unicode{"203A}$0\\unicode{"2039}'),Vu("Spacing",["\\hspace","\\hspace*"],Fu,'\\unicode{"203A}$0{1em}\\unicode{"2039}'),Vu("Punctuation",["\\colon","\\cdotp","\\ldots","\\cdots","\\ddots","\\vdots","?","!",":",'"',",",".",";"],Hu),Vu("Punctuation",["\\mathellipsis","\\ldotp","\\Colon"],Fu),Vu("Boxes",["\\square","\\Box"],Hu),Vu("Boxes",["\\blacksquare","\\boxminus","\\boxplus","\\boxtimes","\\boxdot"],Fu),Vu("Circles",["\\circ","\\bullet","\\circleddash","\\oplus","\\otimes"],Hu),Vu("Circles",["\\bigcirc","\\circledast","\\ominus","\\circledcirc","\\oslash","\\circledS","\\circledR","\\odot"],Fu),Vu("Triangles",["\\triangle","\\triangleq"],Hu),Vu("Triangles",["\\bigtriangleup","\\vartriangle","\\triangledown","\\bigtriangledown","\\triangleleft","\\vartriangleleft","\\trianglelefteq","\\ntriangleleft","\\ntrianglelefteq","\\triangleright","\\vartriangleright","\\trianglerighteq","\\ntriangleright","\\ntrianglerighteq","\\blacktriangle","\\blacktriangledown","\\blacktriangleleft","\\blacktriangleright"],Fu),Vu("Shapes",["\\ast","\\star"],Hu),Vu("Shapes",["\\diamond","\\Diamond","\\lozenge","\\blacklozenge","\\bigstar"],Fu);const Xu=document.createElement("template");Xu.innerHTML='\n
    ';const Yu=new WeakMap;class Ju extends HTMLElement{constructor(e){var t;super(),Gu.set(this,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Xu.content.cloneNode(!0));const n=this.shadowRoot.querySelector("slot:not([name])");this.shadowRoot.host.addEventListener("focus",(e=>this.focus()));try{const e=n.assignedElements().filter((e=>"application/json"!==e.type)).map((e=>e.textContent)).join("");e&&this.setOptions(JSON.parse(e))}catch(e){console.log(e)}e&&this.setOptions(e),this.hasAttribute("value")?this.value=this.getAttribute("value"):this.value=null!==(t=null==n?void 0:n.assignedNodes().map((e=>3===e.nodeType?e.textContent:"")).join("").trim())&&void 0!==t?t:"",n.addEventListener("slotchange",(e=>{if(e.target!==n)return;const t=n.assignedNodes().map((e=>3===e.nodeType?e.textContent:"")).join("").trim();Uu(this,Gu)?Uu(this,Gu).setValue(t,{insertionMode:"replaceAll"}):this.value=t}))}static get optionsAttributes(){return{"default-mode":"string","fonts-directory":"string","horizontal-spacing-scale":"number","ignore-spacebar-in-math-mode":"boolean","inline-shortcut-timeout":"number","keypress-vibration":"boolean","letter-shape-style":"string",locale:"string","read-only":"boolean","remove-extraneous-parentheses":"boolean","smart-fence":"boolean","smart-mode":"boolean","smart-superscript":"boolean","speech-engine":"string","speech-engine-rate":"string","speech-engine-voice":"string","text-to-speech-markup":"string","text-to-speech-rules":"string","virtual-keyboard-layout":"string","virtual-keyboard-mode":"string","virtual-keyboard-theme":"string","virtual-keyboards":"string"}}static get observedAttributes(){return[...Object.keys(Ju.optionsAttributes),"disabled"]}get mode(){var e;return null===(e=Uu(this,Gu))||void 0===e?void 0:e.mode}set mode(e){Uu(this,Gu)&&(Uu(this,Gu).mode=e)}getOptions(e){return Uu(this,Gu)?wd(Uu(this,Gu).options,e):Yu.has(this)?wd(xd(kd(),Yu.get(this).options),e):null}getOption(e){return this.getOptions([e])}setOptions(e){Uu(this,Gu)?Uu(this,Gu).setOptions(e):Yu.has(this)?Yu.set(this,{value:Yu.get(this).value,selection:[{start:0,end:-1}],options:{...Yu.get(this).options,...e}}):Yu.set(this,{value:"",selection:[{start:0}],options:e}),function(e){const t=kd(),n=e.getOptions();Object.keys(Ju.optionsAttributes).forEach((r=>{const o=Qu(r);t[o]!==n[o]&&("boolean"===Ju.optionsAttributes[r]?n[o]?e.setAttribute(r,""):e.removeAttribute(r):e.setAttribute(r,n[o].toString()))}))}(this)}executeCommand(e){var t,n;return null!==(n=null===(t=Uu(this,Gu))||void 0===t?void 0:t.executeCommand(e))&&void 0!==n&&n}getValue(e,t,n){var r,o;let i,a;if(void 0===e?(a="latex",i=[{start:0,end:-1}]):"string"==typeof e?(a=e,i=[{start:0,end:-1}]):"number"==typeof e&&"number"==typeof t?(i=[{start:e,end:null!=t?t:-1}],a=null!=n?n:"latex"):Array.isArray(e)?(i=e,a=null!==(r=t)&&void 0!==r?r:"latex"):(i=[e],a=null!==(o=t)&&void 0!==o?o:"latex"),Uu(this,Gu))return Uu(this,Gu).getValue(i,a);if(Yu.has(this)){const e=1===i.length&&0===i[0].start&&-1===i[0].end;if("latex"===a&&e)return Yu.get(this).value}}setValue(e,t){Uu(this,Gu)?Uu(this,Gu).setValue(e,t):Yu.has(this)?Yu.set(this,{value:e,selection:[{start:0,end:-1,direction:"forward"}],options:Yu.get(this).options}):Yu.set(this,{value:e,selection:[{start:0,end:-1,direction:"forward"}],options:ep(this)})}hasFocus(){var e,t;return null!==(t=null===(e=Uu(this,Gu))||void 0===e?void 0:e.hasFocus())&&void 0!==t&&t}focus(){var e;null===(e=Uu(this,Gu))||void 0===e||e.focus()}blur(){var e;null===(e=Uu(this,Gu))||void 0===e||e.blur()}select(){var e;null===(e=Uu(this,Gu))||void 0===e||e.select()}insert(e,t){var n,r;return null!==(r=null===(n=Uu(this,Gu))||void 0===n?void 0:n.insert(e,t))&&void 0!==r&&r}applyStyle(e){var t;return null===(t=Uu(this,Gu))||void 0===t?void 0:t.applyStyle(e)}get caretPoint(){var e,t;return null!==(t=null===(e=Uu(this,Gu))||void 0===e?void 0:e.getCaretPoint())&&void 0!==t?t:null}set caretPoint(e){var t;null===(t=Uu(this,Gu))||void 0===t||t.setCaretPoint(e.x,e.y)}setCaretPoint(e,t){var n,r;return null!==(r=null===(n=Uu(this,Gu))||void 0===n?void 0:n.setCaretPoint(e,t))&&void 0!==r&&r}find(e){var t,n;return null!==(n=null===(t=Uu(this,Gu))||void 0===t?void 0:t.find(e))&&void 0!==n?n:[]}connectedCallback(){if(this.hasAttribute("role")||this.setAttribute("role","textbox"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),Zu(this,Gu,new Ku(this.shadowRoot.querySelector(":host > div"),{...ep(this),...Yu.has(this)?Yu.get(this).options:{},onBlur:()=>{this.dispatchEvent(new Event("blur",{cancelable:!1,bubbles:!1}))},onContentDidChange:()=>{this.dispatchEvent(new Event("input",{cancelable:!1,bubbles:!0}))},onError:e=>{this.dispatchEvent(new CustomEvent("math-error",{detail:{code:e.code,arg:e.arg,latex:e.latex,before:e.before,after:e.after},cancelable:!1,bubbles:!0}))},onFocus:()=>{this.dispatchEvent(new Event("focus",{cancelable:!1,bubbles:!1}))},onKeystroke:(e,t,n)=>this.dispatchEvent(new CustomEvent("keystroke",{detail:{keystroke:t,event:n},cancelable:!0,bubbles:!0})),onModeChange:(e,t)=>{this.dispatchEvent(new Event("mode-change",{cancelable:!1,bubbles:!0}))},onCommit:e=>{this.dispatchEvent(new Event("change",{cancelable:!1,bubbles:!0}))},onMoveOutOf:(e,t)=>this.dispatchEvent(new CustomEvent("focus-out",{detail:{direction:t},cancelable:!0,bubbles:!0})),onTabOutOf:(e,t)=>this.dispatchEvent(new CustomEvent("focus-out",{detail:{direction:t},cancelable:!0,bubbles:!0})),onReadAloudStatus:()=>{this.dispatchEvent(new Event("read-aloud-status-change",{cancelable:!1,bubbles:!0}))},onSelectionDidChange:()=>{this.dispatchEvent(new Event("selection-change",{cancelable:!1,bubbles:!0}))},onUndoStateDidChange:()=>{this.dispatchEvent(new Event("undo-state-change",{cancelable:!1,bubbles:!0}))},onVirtualKeyboardToggle:(e,t,n)=>{this.dispatchEvent(new Event("virtual-keyboard-toggle",{bubbles:!0,cancelable:!1}))}})),Yu.has(this)){const e=Uu(this,Gu).model.suppressChangeNotifications;Uu(this,Gu).model.suppressChangeNotifications=!0,Uu(this,Gu).setValue(Yu.get(this).value),Uu(this,Gu).selection=Yu.get(this).selection,Yu.delete(this),Uu(this,Gu).model.suppressChangeNotifications=e}this.upgradeProperty("disabled"),this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0}))}disconnectedCallback(){if(this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0})),!Uu(this,Gu))return;const e={};Object.keys(Ju.optionsAttributes).forEach((t=>{e[Qu(t)]=Uu(this,Gu).getOption(Qu(t))})),Yu.set(this,{value:Uu(this,Gu).getValue(),selection:Uu(this,Gu).selection,options:e}),Uu(this,Gu).dispose(),Zu(this,Gu,null)}upgradeProperty(e){if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this[e]=t}}attributeChangedCallback(e,t,n){if(t===n)return;const r=null!==n;"disabled"===e&&(this.disabled=r)}set disabled(e){const t=Boolean(e);t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this.setAttribute("aria-disabled",t?"true":"false"),this.setOptions({readOnly:t})}get disabled(){return this.hasAttribute("disabled")}set value(e){this.setValue(e)}get value(){return this.getValue()}get selection(){return Uu(this,Gu)?Uu(this,Gu).selection:Yu.has(this)?Yu.get(this).selection:[{start:0,direction:"forward"}]}set selection(e){Uu(this,Gu)&&(Uu(this,Gu).selection=e),Yu.has(this)?Yu.set(this,{value:Yu.get(this).value,selection:e,options:Yu.get(this).options}):Yu.set(this,{value:"",selection:e,options:ep(this)})}get position(){var e;const t=this.selection;return"backward"===t[t.length-1].direction?t[t.length-1].start:null!==(e=t[0].end)&&void 0!==e?e:t[0].start}set position(e){this.selection=[{start:e}]}get lastPosition(){var e,t;return null!==(t=null===(e=Uu(this,Gu))||void 0===e?void 0:e.lastPosition)&&void 0!==t?t:-1}}function Qu(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,((e,t)=>t.toUpperCase()))}function ep(e){const t={},n=Ju.optionsAttributes;return Object.keys(n).forEach((r=>{if(e.hasAttribute(r)){const o=e.getAttribute(r);if("boolean"===n[r]){const e=o.toLowerCase();t[Qu(r)]="true"===e||"yes"===e||"on"===e}else"number"===n[r]?t[Qu(r)]=parseFloat(o):t[Qu(r)]=o}})),t}function tp(e,t){var n;(t=null!=t?t:{}).mathstyle=t.mathstyle||"displaystyle",t.letterShapeStyle=t.letterShapeStyle||"auto",t.macros={...ia,...null!==(n=t.macros)&&void 0!==n?n:{}};const r=_s(e,"math",null,t.macros,!1,t.onError);let o=ms({mathstyle:Li[t.mathstyle],letterShapeStyle:t.letterShapeStyle},r);return o=Hi(o),"span"===t.format?o:Xi(Zi(o,"ML__base"),"ML__mathlive").toMarkup()}Gu=new WeakMap,window.customElements.get("math-field")||(window.MathfieldElement=Ju,window.customElements.define("math-field",Ju));var np=new Mt("interface");function rp(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(o.activeNodeViews);try{for(a.s();!(i=a.n()).done;)i.value.updateCursorPos(r)}catch(e){a.e(e)}finally{a.f()}}return t}},props:{nodeViews:{mathlive:function(e,t,n){var r=lp.getState(t.state);if(!r)throw new Error("no math plugin!");var o=r.activeNodeViews,i=new op(e,t,n);return o.push(i),i}}}}),dp=[(sp={depth:sp&&sp.depth||100,newGroupDelay:sp&&sp.newGroupDelay||500},new wt({key:ii,state:{init:function(){return new Yo(Go.empty,Go.empty,null,0)},apply:function(e,t,n){return function(e,t,n,r){var o,i=n.getMeta(ii);if(i)return i.historyState;n.getMeta(ai)&&(e=new Yo(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(ii))return a.getMeta(ii).redo?new Yo(e.done.addTransform(n,null,r,oi(t)),e.undone,Qo(n.mapping.maps[n.steps.length-1]),e.prevTime):new Yo(e.done,e.undone.addTransform(n,null,r,oi(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Yo(e.done.rebased(n,o),e.undone.rebased(n,o),ei(e.prevRanges,n.mapping),e.prevTime):new Yo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ei(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=a?ei(e.prevRanges,n.mapping):Qo(n.mapping.maps[n.steps.length-1]);return new Yo(e.done.addTransform(n,s?t.selection.getBookmark():null,r,oi(t)),Go.empty,l,n.time)}(t,n,e,sp)}},config:sp})),cp,(ap={"Ctrl-z":function(e,t){var n=ii.getState(e);return!(!n||0==n.done.eventCount||(t&&ti(n,e,t,!1),0))},"Ctrl-y":function(e,t){var n=ii.getState(e);return!(!n||0==n.undone.eventCount||(t&&ti(n,e,t,!0),0))},Enter:Oo(Eo,zo,Co),"Ctrl-Enter":Oo(Eo,Co),Backspace:Oo(yo,(function(e,t){var n=e.selection.$from,r=n.nodeBefore;if(!r)return!1;if("mathlive"===r.type.name){var o=n.index(n.depth),i=e.doc.resolve(n.posAtIndex(o-1));return t&&t(e.tr.setSelection(new at(i))),!0}return!1}),vo,xo),Delete:Oo(yo,ko,_o)},new wt({props:{handleKeyDown:function(e){var t=function(e){var t=Object.create(null);for(var n in e)t[qo(n)]=e[n];return t}(e);return function(e,n){var r,o=function(e){var t=!(Bo&&(e.ctrlKey||e.altKey||e.metaKey)||(Po||Ro)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Ao:To)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=1==o.length&&" "!=o,a=t[Fo(o,n,!i)];if(a&&a(e.state,e.dispatch,e))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=To[n.keyCode])&&r!=o){var s=t[Fo(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var l=t[Fo(o,n,!0)];if(l&&l(e.state,e.dispatch,e))return!0}return!1}}(ap)}}))];function up(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nspan{display:block;height:0;position:relative;line-height:0}.ML__mathlive .vlist>span>span{display:inline-block}.ML__mathlive .msubsup{text-align:left}.ML__mathlive .mfrac>span{text-align:center}.ML__mathlive .mfrac .frac-line{width:100%}.ML__mathlive .mfrac .frac-line:after{content:"";display:block;margin-top:-.04em;min-height:.04em;background:currentColor;box-sizing:content-box;transform:translate(0)}.ML__mathlive .rspace.negativethinspace{margin-right:-.16667em}.ML__mathlive .rspace.thinspace{margin-right:.16667em}.ML__mathlive .rspace.negativemediumspace{margin-right:-.22222em}.ML__mathlive .rspace.mediumspace{margin-right:.22222em}.ML__mathlive .rspace.thickspace{margin-right:.27778em}.ML__mathlive .rspace.sixmuspace{margin-right:.333333em}.ML__mathlive .rspace.eightmuspace{margin-right:.444444em}.ML__mathlive .rspace.enspace{margin-right:.5em}.ML__mathlive .rspace.twelvemuspace{margin-right:.666667em}.ML__mathlive .rspace.quad{margin-right:1em}.ML__mathlive .rspace.qquad{margin-right:2em}.ML__mathlive .mspace{display:inline-block}.ML__mathlive .mspace.negativethinspace{margin-left:-.16667em}.ML__mathlive .mspace.thinspace{width:.16667em}.ML__mathlive .mspace.negativemediumspace{margin-left:-.22222em}.ML__mathlive .mspace.mediumspace{width:.22222em}.ML__mathlive .mspace.thickspace{width:.27778em}.ML__mathlive .mspace.sixmuspace{width:.333333em}.ML__mathlive .mspace.eightmuspace{width:.444444em}.ML__mathlive .mspace.enspace{width:.5em}.ML__mathlive .mspace.twelvemuspace{width:.666667em}.ML__mathlive .mspace.quad{width:1em}.ML__mathlive .mspace.qquad{width:2em}.ML__mathlive .llap,.ML__mathlive .rlap{width:0;position:relative}.ML__mathlive .llap>.inner,.ML__mathlive .rlap>.inner{position:absolute}.ML__mathlive .llap>.fix,.ML__mathlive .rlap>.fix{display:inline-block}.ML__mathlive .llap>.inner{right:0}.ML__mathlive .rlap>.inner{left:0}.ML__mathlive .rule{display:inline-block;border:0 solid;position:relative}.ML__mathlive .overline .overline-line,.ML__mathlive .underline .underline-line{width:100%}.ML__mathlive .overline .overline-line:before,.ML__mathlive .underline .underline-line:before{border-bottom-style:solid;border-bottom-width:.04em;content:"";display:block}.ML__mathlive .overline .overline-line:after,.ML__mathlive .underline .underline-line:after{border-bottom-style:solid;border-bottom-width:.04em;min-height:thin;content:"";display:block;margin-top:-1px}.ML__mathlive .stretchy{display:block;position:absolute;width:100%;left:0;overflow:hidden}.ML__mathlive .stretchy:after,.ML__mathlive .stretchy:before{content:""}.ML__mathlive .stretchy svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.ML__mathlive .slice-1-of-2{left:0}.ML__mathlive .slice-1-of-2,.ML__mathlive .slice-2-of-2{display:inline-flex;position:absolute;width:50.2%;overflow:hidden}.ML__mathlive .slice-2-of-2{right:0}.ML__mathlive .slice-1-of-3{display:inline-flex;position:absolute;left:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-2-of-3{display:inline-flex;position:absolute;left:25%;width:50%;overflow:hidden}.ML__mathlive .slice-3-of-3{display:inline-flex;position:absolute;right:0;width:25.1%;overflow:hidden}.ML__mathlive .slice-1-of-1{display:inline-flex;position:absolute;width:100%;left:0;overflow:hidden}.ML__mathlive .sqrt{display:inline-block}.ML__mathlive .sqrt>.sqrt-sign{font-family:KaTeX_Main;position:relative}.ML__mathlive .sqrt .sqrt-line{height:.04em;width:100%}.ML__mathlive .sqrt .sqrt-line:before{content:"";display:block;margin-top:-.04em;min-height:.04em;background:currentColor}.ML__mathlive .sqrt .sqrt-line:after{border-bottom-width:1px;content:" ";display:block;margin-top:-.1em;transform:translate(0)}.ML__mathlive .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.ML__mathlive .fontsize-ensurer,.ML__mathlive .sizing{display:inline-block}.ML__mathlive .fontsize-ensurer.reset-size1.size1,.ML__mathlive .sizing.reset-size1.size1{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size1.size2,.ML__mathlive .sizing.reset-size1.size2{font-size:1.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size3,.ML__mathlive .sizing.reset-size1.size3{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size1.size4,.ML__mathlive .sizing.reset-size1.size4{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size1.size5,.ML__mathlive .sizing.reset-size1.size5{font-size:2em}.ML__mathlive .fontsize-ensurer.reset-size1.size6,.ML__mathlive .sizing.reset-size1.size6{font-size:2.4em}.ML__mathlive .fontsize-ensurer.reset-size1.size7,.ML__mathlive .sizing.reset-size1.size7{font-size:2.88em}.ML__mathlive .fontsize-ensurer.reset-size1.size8,.ML__mathlive .sizing.reset-size1.size8{font-size:3.46em}.ML__mathlive .fontsize-ensurer.reset-size1.size9,.ML__mathlive .sizing.reset-size1.size9{font-size:4.14em}.ML__mathlive .fontsize-ensurer.reset-size1.size10,.ML__mathlive .sizing.reset-size1.size10{font-size:4.98em}.ML__mathlive .fontsize-ensurer.reset-size2.size1,.ML__mathlive .sizing.reset-size2.size1{font-size:.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size2,.ML__mathlive .sizing.reset-size2.size2{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size2.size3,.ML__mathlive .sizing.reset-size2.size3{font-size:1.14285714em}.ML__mathlive .fontsize-ensurer.reset-size2.size4,.ML__mathlive .sizing.reset-size2.size4{font-size:1.28571429em}.ML__mathlive .fontsize-ensurer.reset-size2.size5,.ML__mathlive .sizing.reset-size2.size5{font-size:1.42857143em}.ML__mathlive .fontsize-ensurer.reset-size2.size6,.ML__mathlive .sizing.reset-size2.size6{font-size:1.71428571em}.ML__mathlive .fontsize-ensurer.reset-size2.size7,.ML__mathlive .sizing.reset-size2.size7{font-size:2.05714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size8,.ML__mathlive .sizing.reset-size2.size8{font-size:2.47142857em}.ML__mathlive .fontsize-ensurer.reset-size2.size9,.ML__mathlive .sizing.reset-size2.size9{font-size:2.95714286em}.ML__mathlive .fontsize-ensurer.reset-size2.size10,.ML__mathlive .sizing.reset-size2.size10{font-size:3.55714286em}.ML__mathlive .fontsize-ensurer.reset-size3.size1,.ML__mathlive .sizing.reset-size3.size1{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size3.size2,.ML__mathlive .sizing.reset-size3.size2{font-size:.875em}.ML__mathlive .fontsize-ensurer.reset-size3.size3,.ML__mathlive .sizing.reset-size3.size3{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size3.size4,.ML__mathlive .sizing.reset-size3.size4{font-size:1.125em}.ML__mathlive .fontsize-ensurer.reset-size3.size5,.ML__mathlive .sizing.reset-size3.size5{font-size:1.25em}.ML__mathlive .fontsize-ensurer.reset-size3.size6,.ML__mathlive .sizing.reset-size3.size6{font-size:1.5em}.ML__mathlive .fontsize-ensurer.reset-size3.size7,.ML__mathlive .sizing.reset-size3.size7{font-size:1.8em}.ML__mathlive .fontsize-ensurer.reset-size3.size8,.ML__mathlive .sizing.reset-size3.size8{font-size:2.1625em}.ML__mathlive .fontsize-ensurer.reset-size3.size9,.ML__mathlive .sizing.reset-size3.size9{font-size:2.5875em}.ML__mathlive .fontsize-ensurer.reset-size3.size10,.ML__mathlive .sizing.reset-size3.size10{font-size:3.1125em}.ML__mathlive .fontsize-ensurer.reset-size4.size1,.ML__mathlive .sizing.reset-size4.size1{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size4.size2,.ML__mathlive .sizing.reset-size4.size2{font-size:.77777778em}.ML__mathlive .fontsize-ensurer.reset-size4.size3,.ML__mathlive .sizing.reset-size4.size3{font-size:.88888889em}.ML__mathlive .fontsize-ensurer.reset-size4.size4,.ML__mathlive .sizing.reset-size4.size4{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size4.size5,.ML__mathlive .sizing.reset-size4.size5{font-size:1.11111111em}.ML__mathlive .fontsize-ensurer.reset-size4.size6,.ML__mathlive .sizing.reset-size4.size6{font-size:1.33333333em}.ML__mathlive .fontsize-ensurer.reset-size4.size7,.ML__mathlive .sizing.reset-size4.size7{font-size:1.6em}.ML__mathlive .fontsize-ensurer.reset-size4.size8,.ML__mathlive .sizing.reset-size4.size8{font-size:1.92222222em}.ML__mathlive .fontsize-ensurer.reset-size4.size9,.ML__mathlive .sizing.reset-size4.size9{font-size:2.3em}.ML__mathlive .fontsize-ensurer.reset-size4.size10,.ML__mathlive .sizing.reset-size4.size10{font-size:2.76666667em}.ML__mathlive .fontsize-ensurer.reset-size5.size1,.ML__mathlive .sizing.reset-size5.size1{font-size:.5em}.ML__mathlive .fontsize-ensurer.reset-size5.size2,.ML__mathlive .sizing.reset-size5.size2{font-size:.7em}.ML__mathlive .fontsize-ensurer.reset-size5.size3,.ML__mathlive .sizing.reset-size5.size3{font-size:.8em}.ML__mathlive .fontsize-ensurer.reset-size5.size4,.ML__mathlive .sizing.reset-size5.size4{font-size:.9em}.ML__mathlive .fontsize-ensurer.reset-size5.size5,.ML__mathlive .sizing.reset-size5.size5{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size5.size6,.ML__mathlive .sizing.reset-size5.size6{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size5.size7,.ML__mathlive .sizing.reset-size5.size7{font-size:1.44em}.ML__mathlive .fontsize-ensurer.reset-size5.size8,.ML__mathlive .sizing.reset-size5.size8{font-size:1.73em}.ML__mathlive .fontsize-ensurer.reset-size5.size9,.ML__mathlive .sizing.reset-size5.size9{font-size:2.07em}.ML__mathlive .fontsize-ensurer.reset-size5.size10,.ML__mathlive .sizing.reset-size5.size10{font-size:2.49em}.ML__mathlive .fontsize-ensurer.reset-size6.size1,.ML__mathlive .sizing.reset-size6.size1{font-size:.41666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size2,.ML__mathlive .sizing.reset-size6.size2{font-size:.58333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size3,.ML__mathlive .sizing.reset-size6.size3{font-size:.66666667em}.ML__mathlive .fontsize-ensurer.reset-size6.size4,.ML__mathlive .sizing.reset-size6.size4{font-size:.75em}.ML__mathlive .fontsize-ensurer.reset-size6.size5,.ML__mathlive .sizing.reset-size6.size5{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size6.size6,.ML__mathlive .sizing.reset-size6.size6{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size6.size7,.ML__mathlive .sizing.reset-size6.size7{font-size:1.2em}.ML__mathlive .fontsize-ensurer.reset-size6.size8,.ML__mathlive .sizing.reset-size6.size8{font-size:1.44166667em}.ML__mathlive .fontsize-ensurer.reset-size6.size9,.ML__mathlive .sizing.reset-size6.size9{font-size:1.725em}.ML__mathlive .fontsize-ensurer.reset-size6.size10,.ML__mathlive .sizing.reset-size6.size10{font-size:2.075em}.ML__mathlive .fontsize-ensurer.reset-size7.size1,.ML__mathlive .sizing.reset-size7.size1{font-size:.34722222em}.ML__mathlive .fontsize-ensurer.reset-size7.size2,.ML__mathlive .sizing.reset-size7.size2{font-size:.48611111em}.ML__mathlive .fontsize-ensurer.reset-size7.size3,.ML__mathlive .sizing.reset-size7.size3{font-size:.55555556em}.ML__mathlive .fontsize-ensurer.reset-size7.size4,.ML__mathlive .sizing.reset-size7.size4{font-size:.625em}.ML__mathlive .fontsize-ensurer.reset-size7.size5,.ML__mathlive .sizing.reset-size7.size5{font-size:.69444444em}.ML__mathlive .fontsize-ensurer.reset-size7.size6,.ML__mathlive .sizing.reset-size7.size6{font-size:.83333333em}.ML__mathlive .fontsize-ensurer.reset-size7.size7,.ML__mathlive .sizing.reset-size7.size7{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size7.size8,.ML__mathlive .sizing.reset-size7.size8{font-size:1.20138889em}.ML__mathlive .fontsize-ensurer.reset-size7.size9,.ML__mathlive .sizing.reset-size7.size9{font-size:1.4375em}.ML__mathlive .fontsize-ensurer.reset-size7.size10,.ML__mathlive .sizing.reset-size7.size10{font-size:1.72916667em}.ML__mathlive .fontsize-ensurer.reset-size8.size1,.ML__mathlive .sizing.reset-size8.size1{font-size:.28901734em}.ML__mathlive .fontsize-ensurer.reset-size8.size2,.ML__mathlive .sizing.reset-size8.size2{font-size:.40462428em}.ML__mathlive .fontsize-ensurer.reset-size8.size3,.ML__mathlive .sizing.reset-size8.size3{font-size:.46242775em}.ML__mathlive .fontsize-ensurer.reset-size8.size4,.ML__mathlive .sizing.reset-size8.size4{font-size:.52023121em}.ML__mathlive .fontsize-ensurer.reset-size8.size5,.ML__mathlive .sizing.reset-size8.size5{font-size:.57803468em}.ML__mathlive .fontsize-ensurer.reset-size8.size6,.ML__mathlive .sizing.reset-size8.size6{font-size:.69364162em}.ML__mathlive .fontsize-ensurer.reset-size8.size7,.ML__mathlive .sizing.reset-size8.size7{font-size:.83236994em}.ML__mathlive .fontsize-ensurer.reset-size8.size8,.ML__mathlive .sizing.reset-size8.size8{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size8.size9,.ML__mathlive .sizing.reset-size8.size9{font-size:1.19653179em}.ML__mathlive .fontsize-ensurer.reset-size8.size10,.ML__mathlive .sizing.reset-size8.size10{font-size:1.43930636em}.ML__mathlive .fontsize-ensurer.reset-size9.size1,.ML__mathlive .sizing.reset-size9.size1{font-size:.24154589em}.ML__mathlive .fontsize-ensurer.reset-size9.size2,.ML__mathlive .sizing.reset-size9.size2{font-size:.33816425em}.ML__mathlive .fontsize-ensurer.reset-size9.size3,.ML__mathlive .sizing.reset-size9.size3{font-size:.38647343em}.ML__mathlive .fontsize-ensurer.reset-size9.size4,.ML__mathlive .sizing.reset-size9.size4{font-size:.43478261em}.ML__mathlive .fontsize-ensurer.reset-size9.size5,.ML__mathlive .sizing.reset-size9.size5{font-size:.48309179em}.ML__mathlive .fontsize-ensurer.reset-size9.size6,.ML__mathlive .sizing.reset-size9.size6{font-size:.57971014em}.ML__mathlive .fontsize-ensurer.reset-size9.size7,.ML__mathlive .sizing.reset-size9.size7{font-size:.69565217em}.ML__mathlive .fontsize-ensurer.reset-size9.size8,.ML__mathlive .sizing.reset-size9.size8{font-size:.83574879em}.ML__mathlive .fontsize-ensurer.reset-size9.size9,.ML__mathlive .sizing.reset-size9.size9{font-size:1em}.ML__mathlive .fontsize-ensurer.reset-size9.size10,.ML__mathlive .sizing.reset-size9.size10{font-size:1.20289855em}.ML__mathlive .fontsize-ensurer.reset-size10.size1,.ML__mathlive .sizing.reset-size10.size1{font-size:.20080321em}.ML__mathlive .fontsize-ensurer.reset-size10.size2,.ML__mathlive .sizing.reset-size10.size2{font-size:.2811245em}.ML__mathlive .fontsize-ensurer.reset-size10.size3,.ML__mathlive .sizing.reset-size10.size3{font-size:.32128514em}.ML__mathlive .fontsize-ensurer.reset-size10.size4,.ML__mathlive .sizing.reset-size10.size4{font-size:.36144578em}.ML__mathlive .fontsize-ensurer.reset-size10.size5,.ML__mathlive .sizing.reset-size10.size5{font-size:.40160643em}.ML__mathlive .fontsize-ensurer.reset-size10.size6,.ML__mathlive .sizing.reset-size10.size6{font-size:.48192771em}.ML__mathlive .fontsize-ensurer.reset-size10.size7,.ML__mathlive .sizing.reset-size10.size7{font-size:.57831325em}.ML__mathlive .fontsize-ensurer.reset-size10.size8,.ML__mathlive .sizing.reset-size10.size8{font-size:.69477912em}.ML__mathlive .fontsize-ensurer.reset-size10.size9,.ML__mathlive .sizing.reset-size10.size9{font-size:.8313253em}.ML__mathlive .fontsize-ensurer.reset-size10.size10,.ML__mathlive .sizing.reset-size10.size10{font-size:1em}.ML__mathlive .delimsizing.size1{font-family:KaTeX_Size1}.ML__mathlive .delimsizing.size2{font-family:KaTeX_Size2}.ML__mathlive .delimsizing.size3{font-family:KaTeX_Size3}.ML__mathlive .delimsizing.size4{font-family:KaTeX_Size4}.ML__mathlive .delimsizing.mult .delim-size1{font-family:KaTeX_Size1;vertical-align:top}.ML__mathlive .delimsizing.mult .delim-size4{font-family:KaTeX_Size4;vertical-align:top}.ML__mathlive .nulldelimiter{width:.12em}.ML__mathlive .op-symbol{position:relative}.ML__mathlive .op-symbol.small-op{font-family:KaTeX_Size1}.ML__mathlive .op-symbol.large-op{font-family:KaTeX_Size2}.ML__mathlive .op-limits .vlist>span{text-align:center}.ML__mathlive .op-over-under{position:relative}.ML__mathlive .op-over-under>.vlist>span:first-child,.ML__mathlive .op-over-under>.vlist>span:last-child{text-align:center}.ML__mathlive .accent>.vlist>span{text-align:center}.ML__mathlive .accent .accent-body>span{font-family:KaTeX_Main;width:0}.ML__mathlive .accent .accent-body.accent-vec>span{position:relative;left:.326em}.ML__mathlive .mtable .vertical-separator{display:inline-block;margin:0 -.025em;border-right:.05em solid}.ML__mathlive .mtable .arraycolsep{display:inline-block}.ML__mathlive .mtable .col-align-m>.vlist{text-align:center}.ML__mathlive .mtable .col-align-c>.vlist{text-align:center}.ML__mathlive .mtable .col-align-l>.vlist{text-align:left}.ML__mathlive .mtable .col-align-r>.vlist{text-align:right}.ML__error{background-image:radial-gradient(ellipse at center,#cc0041,transparent 70%);background-repeat:repeat-x;background-size:3px 3px;background-position:0 98%}.ML__composition{background:#fff1c2;color:#000;-webkit-text-decoration:underline var(--caret,hsl(var(--hue,212),40%,49%));text-decoration:underline var(--caret,hsl(var(--hue,212),40%,49%))}@media (prefers-color-scheme:dark){.ML__composition{background:#69571c;color:#fff}}.ML__placeholder{opacity:.7;padding-left:.4ex;padding-right:.4ex;padding-top:.4ex}\n',""]),t.Z=U},425:function(e,t,n){var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".eWorkspace-container {\n margin: 32px 0 32px 80px;\n}\n\n.eWorkspace-new {\n display: flex;\n justify-content: flex-end;\n margin-top: 1.5em;\n}\n\n.eWorkspace-header-with-archive {\n display: flex;\n justify-content: space-between;\n}\n\n.eWorkspace-header {\n font-weight: 600;\n}\n\n.eWorkspace-header-new {\n border-bottom: 1px solid #000000;\n font-weight: 600;\n}\n\n.eWorkspace-archive-toggle {\n display: block;\n cursor: pointer;\n text-align: right;\n text-decoration: underline;\n}\n\n.eWorkspace-entry-inner textarea {\n width: 100%;\n}\n\n.eWorkspace-entry-inner-actions {\n display: flex;\n background-color: #f3f3f3;\n padding: 12px;\n}\n\n.eWorkspace-entry-inner-action {\n background-color: #f3f3f3;\n padding: 12px;\n}\n\n.inner-action {\n cursor: pointer;\n font-weight: 500;\n margin-left: 8px;\n text-decoration: underline;\n}\n\n.inner-actions {\n margin-top: 16px;\n}\n\n.eWorkspace-entry-inner img {\n max-width: 100%;\n}\n\n.eWorkspace-editor-textarea {\n margin-top: 24px;\n width: 100%;\n}\n\n.eWorkspace-editor-uploaded-image {\n margin-top: 24px;\n max-width: 100%;\n}\n\n#eWorkspace-upload-image-input {\n display: none;\n}\n\n#eWorkspace-table-chevron {\n text-align: right;\n}\n\ntable.eWorkspace-entries.table button.btn {\n font-family: Sans-Serif;\n}\n\n.eWorkspace-submission-header {\n font-family: Sans-Serif;\n font-weight: bold;\n}\n.eWorkspace-submission-review-date {\n float: left;\n margin-bottom: 6px;\n}\n.eWorkspace-submission-archive-toggle {\n float: right;\n margin-bottom: 6px;\n}\n\n.eWorkspace-icon-button {\n border: none;\n background: none;\n cursor: pointer;\n}\n\n.eWorkspace-entries {\n font-family: Sans-Serif;\n}\n.eWorkspace-entries > thead > tr > th {\n background-color: #233364;\n border: none;\n color: white;\n padding: 12px;\n}\n\ntr.eWorkspace-entry.TEACHER_ANSWER {\n background-color: #e0e0e0;\n}\ntr.eWorkspace-entry > td {\n border-top: 1px solid #000000;\n padding: 12px;\n}\ntr.eWorkspace-entry-content > td {\n border: 0;\n padding: 0;\n}\n\n.eWorkspace-submission-editor,\n.eWorkspace-align-right {\n text-align: right;\n}\n.eWorkspace-container textarea {\n width: 100%;\n}\nbutton.btn.hide-eWorkspace {\n display: none;\n}\n\n.eWorkspace-table-header {\n font-weight: 600;\n}\n\n.eWorkspace-btn {\n border: 0;\n border-radius: 4px;\n box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),\n 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);\n font-weight: 500;\n min-width: 80px;\n padding: 6px 16px;\n}\n\n.eWorkspace-btn-default {\n background-color: #e0e0e0;\n color: #000000;\n margin-right: 16px;\n}\n\n.eWorkspace-btn-primary {\n background-color: #233364;\n color: #ffffff;\n}\n\n.eWorkspace-btn-delete {\n background-color: #dc3545;\n color: #ffffff;\n}\n\n.eWorkspace-entry-actions {\n display: flex;\n justify-content: flex-end;\n margin-top: 16px;\n}\n\n.eWorkspace-entry-actions-delete {\n display: flex;\n justify-content: space-between;\n margin-top: 16px;\n}\n\n.eWorkspace-editor {\n display: flex;\n flex-direction: column;\n}\n\ntable.eWorkspace-entries.table {\n border: 1px solid #000000;\n margin-top: 0;\n}\n\n.eWorkspace-entry-inner-body {\n padding: 12px;\n}\n\n.eWorkspace-selections {\n align-items: center;\n display: flex;\n justify-content: space-evenly;\n}\n\n.eWorkspace-selection {\n align-items: center;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n}\n\n.eWorkspace-selection-icon {\n font-size: 64px;\n}\n\n.eWorkspace-selection-btn {\n align-self: flex-end;\n}\n\n.eWorkspace-close-icon {\n align-self: flex-end;\n color: #dc3545;\n cursor: pointer;\n}\n\nmath-live {\n border: 1px solid royalblue;\n display: inline-flex;\n padding: 2px;\n margin: 4px;\n}\n\nmath-field {\n border: 1px solid royalblue;\n}\n\n.mathlive-node {\n display: inline-flex;\n padding: 2px;\n margin: 4px;\n cursor: pointer !important;\n}\n\n.mathlive-node > .ML__mathlive > span.ML__base {\n cursor: pointer !important;\n}\n\n.mathlive-node > .ML__mathlive > .ML__base {\n cursor: pointer !important;\n}\n\n.mathlive-node:hover {\n color: royalblue;\n cursor: pointer;\n}\n\n.ProseMirror-container {\n border: 1px solid darkgray;\n}\n\n.ProseMirror {\n padding: 8px;\n}\n\n.ProseMirror-menu {\n background-color: #f3f3f3;\n border-bottom: 1px solid darkgray;\n display: flex;\n justify-content: space-between;\n padding: 4px;\n}\n\n.ProseMirror-menu > .menu-icon {\n cursor: pointer;\n padding: 8px;\n}\n\n.ProseMirror-menu > .menu-icon:hover {\n background-color: #e0e0e0;\n}\n\n.ProseMirror-focused:focus {\n outline: none;\n}\n\n.ProseMirror-selectednode {\n outline: 1px solid royalblue;\n}\n\n.ProseMirror > p {\n margin: 0;\n overflow: hidden;\n}\n\n.ProseMirror-menu-actions-right {\n align-items: center;\n display: flex;\n}\n\n#eWorkspace-modal {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n z-index: 10001;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n position: fixed;\n}\n\n.eWorkspace-modal-backdrop {\n background-color: black;\n z-index: 10000;\n opacity: 0.5;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n position: fixed;\n}\n\n.eWorkspace-modal-backdrop {\n background-color: black;\n z-index: 10000;\n opacity: 0.5;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n position: fixed;\n}\n\n.eWorkspace-modal-content {\n padding: 16px;\n background-color: white;\n box-shadow: 0px 3px 3px -2px rgba(0, 0, 0, 0.2),\n 0px 3px 4px 0px rgba(0, 0, 0, 0.14), 0px 1px 8px 0px rgba(0, 0, 0, 0.12);\n display: flex;\n flex-direction: column;\n max-width: 400px;\n position: relative;\n width: 100%;\n}\n\n.eWorkspace-modal-actions {\n display: flex;\n justify-content: flex-end;\n margin-top: 32px;\n}\n\n.eWorkspace-close-modal {\n cursor: pointer;\n position: absolute;\n top: 0;\n right: 0;\n}\n\n.eWorkspace-modal-top {\n display: flex;\n justify-content: space-between;\n margin-bottom: 32px;\n}\n\n.eWorkspace-modal-title {\n font-weight: 600;\n}\n\n.ML__keyboard {\n margin-bottom: 25px;\n z-index: 10001 !important;\n}\n\n.ML__base {\n cursor: pointer !important;\n}\n",""]),t.Z=o},920:function(e,t,n){var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,'.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror li {\n position: relative;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n/* Make sure li selections wrap around markers */\n\nli.ProseMirror-selectednode {\n outline: none;\n}\n\nli.ProseMirror-selectednode:after {\n content: "";\n position: absolute;\n left: -32px;\n right: -2px; top: -2px; bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n}\n',""]),t.Z=o},645:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i{var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{default:()=>o});var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"changeHeightWidth",value:function(e,t,n,r,o,i){return n>r&&(e=Math.round(e*r/n),n=r),e>t&&(n=Math.round(n*t/e),e=t),o&&n5&&void 0!==arguments[5]?arguments[5]:"jpeg",a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,s=(arguments.length>6&&void 0!==arguments[6]?arguments[6]:100)/100,l=document.createElement("canvas"),c=e.width,d=e.height,u=this.changeHeightWidth(d,n,c,t,r,o);!a||90!==a&&270!==a?(l.width=u.width,l.height=u.height):(l.width=u.height,l.height=u.width),c=u.width,d=u.height;var p=l.getContext("2d");return p.fillStyle="rgba(0, 0, 0, 0)",p.fillRect(0,0,c,d),p.imageSmoothingEnabled&&p.imageSmoothingQuality&&(p.imageSmoothingQuality="high"),a&&(p.rotate(a*Math.PI/180),90===a?p.translate(0,-l.width):180===a?p.translate(-l.width,-l.height):270===a?p.translate(-l.height,0):0!==a&&360!==a||p.translate(0,0)),p.drawImage(e,0,0,c,d),l.toDataURL("image/".concat(i),s)}},{key:"b64toByteArrays",value:function(e,t){for(var n=atob(e.toString().replace(/^data:image\/(png|jpeg|jpg|webp);base64,/,"")),r=[],o=0;o7&&void 0!==arguments[7]?arguments[7]:"base64",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null,u=new FileReader;if(!t)throw Error("File Not Found!");if(t.type&&!t.type.includes("image"))throw Error("File Is NOT Image!");u.readAsDataURL(t),u.onload=function(){var p=new Image;p.src=u.result,p.onload=function(){var u=e.resizeAndRotateImage(p,n,r,c,d,o,i,a),h="image/".concat(o);switch(l){case"blob":var f=e.b64toBlob(u,h);s(f);break;case"base64":default:s(u);break;case"file":var m=t.name.toString().replace(/(png|jpeg|jpg|webp)$/i,"").concat(o.toString()),g=e.b64toFile(u,m,h);s(g)}}},u.onerror=function(e){throw Error(e)}}}],t&&function(e,t){for(var n=0;n{var n,r,o,i,a={6086:(e,t,n)=>{function r(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,l,"next",e)}function l(e){r(a,o,i,s,l,"throw",e)}s(void 0)}))}}n.d(t,{Z:()=>o})},6009:(e,t,n)=>{var r=n(487),o=n(8328);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},566:(e,t,n)=>{var r=n(487),o=n(6121);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},5574:(e,t,n)=>{var r=n(487),o=n(7972);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4518:(e,t,n)=>{var r=n(487),o=n(190);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},3040:(e,t,n)=>{var r=n(487),o=n(6718);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8623:(e,t,n)=>{var r=n(487),o=n(3623);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4193:(e,t,n)=>{var r=n(487),o=n(103);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},341:(e,t,n)=>{var r=n(487),o=n(7061);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},9705:(e,t,n)=>{var r=n(487),o=n(1498);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},7143:(e,t,n)=>{var r=n(487),o=n(666);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},7428:(e,t,n)=>{var r=n(487),o=n(849);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8465:(e,t,n)=>{var r=n(487),o=n(6915);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8680:(e,t,n)=>{var r=n(487),o=n(7030);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},205:(e,t,n)=>{var r=n(487),o=n(3994);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8416:(e,t,n)=>{var r=n(487),o=n(700);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},2816:(e,t,n)=>{var r=n(487),o=n(287);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},1575:(e,t,n)=>{var r=n(487),o=n(5657);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},7287:(e,t,n)=>{var r=n(487),o=n(7392);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8518:(e,t,n)=>{var r=n(487),o=n(6065);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},5849:(e,t,n)=>{var r=n(487),o=n(83);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},9478:(e,t,n)=>{var r=n(487),o=n(1554);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},2680:(e,t,n)=>{var r=n(487),o=n(1970);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},3142:(e,t,n)=>{var r=n(487),o=n(961);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8234:(e,t,n)=>{var r=n(487),o=n(4878);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4651:(e,t,n)=>{var r=n(487),o=n(1988);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},2189:(e,t,n)=>{var r=n(487),o=n(3245);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},487:(e,t,n)=>{var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n{e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"With background","exportEmbedScene":"Embed scene into exported file","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File title","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme"},"buttons":{"clearReset":"Reset the canvas","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"Importing images isn\'t supported at the moment.\\n\\nDid you want to import a scene? This image does not seem to contain any scene data. Have you enabled this during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","resetLibrary":"This will clear your library. Are you sure?"},"toolBar":{"selection":"Selection","draw":"Free draw","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point, CtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to move or remove, or hold Alt and click to add new points"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version."},"errorDialog":{"title":"Error"},"helpDialog":{"blog":"Read our blog","click":"click","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","drag":"drag","editor":"Editor","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text)","textNewLine":"Add new line (text)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them."},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied to clipboard as PNG.","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}"}}')},2051:e=>{e.exports=JSON.parse('{"ar-SA":85,"bg-BG":98,"ca-ES":85,"de-DE":100,"el-GR":100,"en":100,"es-ES":100,"fa-IR":93,"fi-FI":100,"fr-FR":100,"he-IL":85,"hi-IN":96,"hu-HU":85,"id-ID":99,"it-IT":100,"ja-JP":100,"kab-KAB":97,"ko-KR":97,"my-MM":79,"nb-NO":100,"nl-NL":99,"nn-NO":87,"pa-IN":99,"pl-PL":85,"pt-BR":100,"pt-PT":94,"ro-RO":100,"ru-RU":100,"sk-SK":100,"sv-SE":100,"tr-TR":85,"uk-UA":99,"zh-CN":95,"zh-TW":100}')},788:(e,t,n)=>{var r={"./ar-SA.json":[7294,558],"./bg-BG.json":[3860,384],"./ca-ES.json":[750,351],"./de-DE.json":[7439,43],"./el-GR.json":[9422,526],"./en.json":[2829],"./es-ES.json":[2863,317],"./fa-IR.json":[3853,710],"./fi-FI.json":[5472,472],"./fr-FR.json":[3280,364],"./he-IL.json":[3970,262],"./hi-IN.json":[5599,933],"./hu-HU.json":[1516,661],"./id-ID.json":[7992,491],"./it-IT.json":[5963,465],"./ja-JP.json":[1323,137],"./kab-KAB.json":[9230,164],"./ko-KR.json":[7552,60],"./my-MM.json":[1778,242],"./nb-NO.json":[8751,246],"./nl-NL.json":[4675,196],"./nn-NO.json":[7558,920],"./pa-IN.json":[863,280],"./percentages.json":[2051],"./pl-PL.json":[122,852],"./pt-BR.json":[7443,381],"./pt-PT.json":[2560,149],"./ro-RO.json":[5654,752],"./ru-RU.json":[5609,869],"./sk-SK.json":[8684,401],"./sv-SE.json":[1570,698],"./tr-TR.json":[8146,213],"./uk-UA.json":[9746,583],"./zh-CN.json":[9044,304],"./zh-TW.json":[2939,62]};function o(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],o=t[0];return Promise.all(t.slice(1).map(n.e)).then((()=>n.t(o,3)))}o.keys=()=>Object.keys(r),o.id=788,e.exports=o},8328:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var r=n(3645),o=n.n(r),i=n(1667),a=n.n(i),s=n(7628),l=n(9638),c=o()((function(e){return e[1]})),d=a()(s.Z),u=a()(l.Z);c.push([e.id,'@font-face{font-family:"Virgil";src:url('+d+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+u+");font-display:swap}",""]);const p=c},6121:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]);const i=o},7972:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--appearance-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==") left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:12ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--appearance-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .color-picker-keybinding{display:none}}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.Appearance_dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.Appearance_dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const i=o},190:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .context-menu-option{display:block}.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const i=o},6718:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor) * 7);grid-gap:var(--metric);padding:calc(var(--space-factor) * 2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor) * 7) 1fr calc( var(--space-factor) * 7 );position:sticky;top:0;padding:calc(var(--space-factor) * 2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw .Dialog__titleContent{text-align:center}.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw .Dialog .Modal__close{order:-1}}",""]);const i=o},3623:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor) * 3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding) * 2);max-height:25rem}.excalidraw.Appearance_dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor) * 2);align-items:top;justify-content:space-between}.excalidraw .ExportDialog__name{grid-column:project-name;margin:auto}.excalidraw .ExportDialog__name .TextInput{height:calc(1rem - 3px)}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor) * 3)}.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw .ExportDialog__dialog,.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}}',""]);const i=o},103:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .FixedSideContainer{--margin: 0.25rem;position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--margin);top:var(--margin);right:var(--margin);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const i=o},7061:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const i=o},1498:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .HintViewer{position:static;padding-right:2em}}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const i=o},666:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus,.excalidraw .picker button:focus{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus svg,.excalidraw .picker button:focus svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-auto-flow:column;grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .picker-keybinding{display:none}}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.Appearance_dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.Appearance_dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const i=o},849:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);backdrop-filter:saturate(100%) blur(10px);box-shadow:var(--shadow-island);border-radius:4px;padding:calc(var(--padding) * var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]);const i=o},6915:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .layer-ui__library-items{max-height:50vh;overflow:auto}.excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper .encrypted-icon{position:relative;margin-inline-start:15px;display:flex;justify-content:center;align-items:center;border-radius:var(--space-factor);color:#2b8a3e}.excalidraw .layer-ui__wrapper .encrypted-icon svg{width:1.2rem;height:1.2rem}.excalidraw .layer-ui__wrapper__github-corner{top:0;position:absolute;width:40px}:root[dir=ltr] .excalidraw .layer-ui__wrapper__github-corner{right:0}:root[dir=rtl] .excalidraw .layer-ui__wrapper__github-corner{left:0}.excalidraw .layer-ui__wrapper__footer{position:absolute;z-index:100;bottom:0;width:190px}:root[dir=ltr] .excalidraw .layer-ui__wrapper__footer{right:0}:root[dir=rtl] .excalidraw .layer-ui__wrapper__footer{left:0}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.App-menu_bottom--transition-left{transform:translate(-92px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.App-menu_bottom--transition-left{transform:translate(92px, 0)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}",""]);const i=o},7030:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit__dragger{display:flex;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--appearance-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__removeFromLibrary,.excalidraw .library-unit__removeFromLibrary:hover,.excalidraw .library-unit__removeFromLibrary:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:0;position:absolute;right:5px;top:5px}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__pulse{transform:scale(1);animation:library-unit__pulse-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:50%;top:50%;width:20px;height:20px;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__pulse-animation{0%{transform:scale(0.95)}50%{transform:scale(1)}100%{transform:scale(0.95)}}",""]);const i=o},3994:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor) * 10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.3);backdrop-filter:blur(2px)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);backdrop-filter:none;border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor) * 7);height:calc(var(--space-factor) * 7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor) * 5)}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .Modal{padding:0}.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}}",""]);const i=o},700:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const i=o},287:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .popover{position:fixed;z-index:10}",""]);const i=o},5657:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor) * var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:min-content}",""]);const i=o},7392:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:999}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const i=o},6065:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{color:var(--text-primary-color);display:inline-block;border:1.5px solid var(--button-gray-1);line-height:1;padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw .TextInput:not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw .TextInput:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}",""]);const i=o},83:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color)}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const i=o},1554:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;font-family:Cascadia;cursor:pointer;background-color:var(--button-gray-1);-webkit-tap-highlight-color:transparent;border-radius:var(--space-factor)}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--space-factor)}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__label{color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon_size_s .ToolIcon__icon{width:1.4rem;height:1.4rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-1)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:focus,.excalidraw .Modal .ToolIcon_type_button:focus,.excalidraw .ToolIcon_type_button:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:focus+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating:focus{box-shadow:none}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{width:2rem;height:2em}.excalidraw .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon__lock{display:inline-block;position:absolute;top:60px;right:-8px;margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon__lock:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon__lock:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon__lock .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon__lock svg{position:static}}.excalidraw .TooltipIcon{width:.9em;height:.9em;margin-left:5px;margin-top:1px}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw .TooltipIcon{display:none}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const i=o},1970:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Tooltip{position:relative}.excalidraw .Tooltip__label{--arrow-size: 4px;visibility:hidden;background:#000;color:#fff;text-align:center;border-radius:6px;padding:8px;position:absolute;z-index:10;font-size:13px;line-height:1.5;font-weight:500;left:calc(50% + var(--arrow-size) / 2 - 1px);transform:translateX(-50%);word-wrap:break-word}.excalidraw .Tooltip__label::after{content:"";border:var(--arrow-size) solid transparent;position:absolute;left:calc(50% - var(--arrow-size))}.excalidraw .Tooltip__label--above{bottom:calc(100% + var(--arrow-size) + 3px)}.excalidraw .Tooltip__label--above::after{border-top-color:#000;top:100%}.excalidraw .Tooltip__label--below{top:calc(100% + var(--arrow-size) + 3px)}.excalidraw .Tooltip__label--below::after{border-bottom-color:#000;bottom:100%}.excalidraw .Tooltip:hover .Tooltip__label{visibility:visible}.excalidraw .Tooltip__label:hover{visibility:visible}',""]);const i=o},961:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) 40px var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList>*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const i=o},4878:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const i=o},1988:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}:export{isMobileQuery:(max-width: 600px), (max-height: 500px) and (max-width: 1000px);appearanceFilter:invert(93%) hue-rotate(180deg)}:root{--appearance-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url(\'data:image/svg+xml,\');--focus-highlight-color: #a5d8ff;--icon-fill-color: #000000;--icon-green-fill-color: #2b8a3e;--input-bg-color: #ffffff;--input-border-color: #dee2e6;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.9);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.15);--space-factor: 0.25rem;--text-primary-color: #343a40}.excalidraw.Appearance_dark{background:#000}.excalidraw.Appearance_dark.Appearance_dark-background-none{background:none}.excalidraw.Appearance_dark{--appearance-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url(\'data:image/svg+xml,\');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: #1e1e1e;--keybinding-color: #868e96;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #2c2c2c;--select-highlight-color: #4dabf7;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;user-select:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw.Appearance_dark canvas{filter:var(--appearance-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{user-select:none;background-color:var(--button-gray-1);border:0;border-radius:4px;margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus,.excalidraw .buttonList label:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--button-gray-2)}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--button-gray-2)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--button-gray-3)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:36px;height:18px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:1fr auto 1fr;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:1fr auto 1fr;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_bottom>*{pointer-events:all}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .dropdown-select.dropdown-select--floating{position:absolute;margin:.5em}.excalidraw .dropdown-select__language.dropdown-select--floating{position:absolute;bottom:10px}:root[dir=ltr] .excalidraw .dropdown-select__language.dropdown-select--floating{right:44px}:root[dir=rtl] .excalidraw .dropdown-select__language.dropdown-select--floating{left:44px}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{position:absolute;cursor:pointer;fill:#868e96;bottom:14px;width:1.5rem}:root[dir=ltr] .excalidraw .help-icon{right:14px}:root[dir=rtl] .excalidraw .help-icon{left:14px}@media(max-width: 600px),(max-height: 500px)and (max-width: 1000px){.excalidraw aside{display:none}.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .github-corner{position:absolute;top:0;z-index:2}:root[dir=ltr] .excalidraw .github-corner{right:0}:root[dir=rtl] .excalidraw .github-corner{left:0}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const i=o},3245:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"",""]),o.locals={isMobileQuery:"(max-width: 600px), (max-height: 500px) and (max-width: 1000px)",appearanceFilter:"invert(93%) hue-rotate(180deg)"};const i=o},3645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i{e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},9638:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"excalidraw-assets/Cascadia.woff2"},7628:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"excalidraw-assets/FG_Virgil.woff2"},8288:(e,t,n)=>{n.d(t,{iC:()=>a,f:()=>s,qx:()=>l,Iw:()=>c,$e:()=>d,wZ:()=>u,ay:()=>p,oc:()=>h,Oh:()=>f,Ks:()=>r,Vi:()=>m,$C:()=>g,ut:()=>y,_D:()=>v,n5:()=>b,rk:()=>x,Hg:()=>w,hs:()=>k,eQ:()=>_,k:()=>M,LO:()=>S,I:()=>E,Gj:()=>z,nM:()=>C,Lg:()=>L,HM:()=>O,V4:()=>T,EH:()=>A,Gi:()=>D});var r,o=n(2189),i=n.n(o),a="Excalidraw",s=10,l=8,c=5,d=1,u=30,p=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",POINTER:"pointer",MOVE:"move",AUTO:""},f={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(r||(r={}));var m={TEST:"test",DEVELOPMENT:"development"},g={SHAPE_ACTIONS_MENU:"App-menu__left"},y={1:"Virgil",2:"Helvetica",3:"Cascadia"},v="Segoe UI Emoji",b=20,x=1,w="left",k="top",_="{version}",M=20,S={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json"},E={LOCAL_STORAGE_LIBRARY:"excalidraw-library"},z=300,C=500,L=5e3,O=500,T=.1,A={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().appearanceFilter},1888:(e,t,n)=>{function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;teh,defaultLang:()=>p,getElementMap:()=>Yi,getSceneVersion:()=>Ji,getSyncableElements:()=>Xi,languages:()=>h,restore:()=>vc,restoreAppState:()=>yc,restoreElements:()=>gc});var i=n(4698),a=n.n(i),s=n(8288);JSON.parse('{"u2":"@cpmdevops/whiteboard","i8":"0.1.7"}'),"production"!==s.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"/");var l=n(6086),c=n(2829),d=n(2051),u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]t.label?1:-1})).filter((function(e){return d[e.code]>=85})),f="__test__";"production"===s.Vi.DEVELOPMENT&&h.unshift({code:f,label:"test language"},{code:"".concat(f,".rtl"),label:"‪test language (rtl)‬",rtl:!0});var m,g=p,y={},v=function(){var e=(0,l.Z)((function(e){return u(this,(function(t){switch(t.label){case 0:return g=e,document.documentElement.dir=g.rtl?"rtl":"ltr",document.documentElement.lang=g.code,e.code.startsWith(f)?(y={},[3,3]):[3,1];case 1:return[4,n(788)("./".concat(g.code,".json"))];case 2:y=t.sent(),t.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),b=function(){return g},x=function(e,t){for(var n=0;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const r=.5,i=e[t+0],a=e[t+1],s=e[t+2],l=e[t+3],c=T(i,a,r),d=T(a,s,r),u=T(s,l,r),p=T(c,d,r),h=T(d,u,r),f=T(p,h,r);A([i,c,p,f],0,n,o),A([f,h,u,l],0,n,o)}var i,a;return o}function D(e,t){return P(e,0,e.length,t)}function P(e,t,n,r,o){const i=o||[],a=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;rl&&(l=t,c=r)}return Math.sqrt(l)>r?(P(e,t,c+1,r,i),P(e,c,n,r,i)):(i.length||i.push(a),i.push(s)),i}function I(e,t=.15,n){const r=[],o=(e.length-1)/3;for(let n=0;n0?P(r,0,r.length,n):r}function N(e,t,n){if(e&&e.length){const[r,o]=t,i=Math.PI/180*n,a=Math.cos(i),s=Math.sin(i);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-o)*s+r,e[1]=(t-r)*s+(n-o)*a+o}))}}function R(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function B(e,t,n,r){const o=t[1]-e[1],i=e[0]-t[0],a=o*e[0]+i*e[1],s=r[1]-n[1],l=n[0]-r[0],c=s*n[0]+l*n[1],d=o*l-s*i;return d?[(l*a-i*c)/d,(o*c-s*a)/d]:null}function j(e,t,n){const r=e.length;if(r<3)return!1;const o=[Number.MAX_SAFE_INTEGER,n],i=[t,n];let a=0;for(let t=0;t=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])}function K(e,t,n){const r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2}function q(e,t,n,r){const o=K(e,t,n),i=K(e,t,r),a=K(n,r,e),s=K(n,r,t);return o!==i&&a!==s||!(0!==o||!$(e,n,t))||!(0!==i||!$(e,r,t))||!(0!==a||!$(n,e,r))||!(0!==s||!$(n,t,r))}function F(e,t){const n=[0,0],r=Math.round(t.hachureAngle+90);r&&N(e,n,r);const o=function(e,t){const n=[...e];n[0].join(",")!==n[n.length-1].join(",")&&n.push([n[0][0],n[0][1]]);const r=[];if(n&&n.length>2){let e=t.hachureGap;e<0&&(e=4*t.strokeWidth),e=Math.max(e,.1);const o=[];for(let e=0;ee.ymint.ymin?1:e.xt.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!o.length)return r;let i=[],a=o[0].ymin;for(;i.length||o.length;){if(o.length){let e=-1;for(let t=0;ta);t++)e=t;o.splice(0,e+1).forEach((e=>{i.push({s:a,edge:e})}))}if(i=i.filter((e=>!(e.edge.ymax<=a))),i.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),i.length>1)for(let e=0;e=i.length)break;const n=i[e].edge,o=i[t].edge;r.push([[Math.round(n.x),a],[Math.round(o.x),a]])}a+=e,i.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}}return r}(e,t);return r&&(N(e,n,-r),function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),N(r,t,n)}(o,n,-r)),o}class H{constructor(e){this.helper=e}fillPolygon(e,t){return this._fillPolygon(e,t)}_fillPolygon(e,t,n=!1){let r=F(e,t);if(n){const t=this.connectingLines(e,r);r=r.concat(t)}return{type:"fillSketch",ops:this.renderLines(r,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}connectingLines(e,t){const n=[];if(t.length>1)for(let r=1;r3){const t=this.splitOnIntersections(e,i);n.push(...t)}}return n}midPointInPolygon(e,t){return j(e,(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2)}splitOnIntersections(e,t){const n=Math.max(5,.1*R(t)),r=[];for(let o=0;on&&i>n&&r.push({point:e,distance:o})}}}if(r.length>1){const n=r.sort(((e,t)=>e.distance-t.distance)).map((e=>e.point));if(j(e,...t[0])||n.shift(),j(e,...t[1])||n.pop(),n.length<=1)return this.midPointInPolygon(e,t)?[t]:[];const o=[t[0],...n,t[1]],i=[];for(let t=0;t{const i=R(e),a=Math.floor(i/(n+r)),s=(i+r-a*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const d=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e{const o=R(e),i=Math.round(o/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);const l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;er%2?e+n:e+t));i.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":i.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map(((e,r)=>r%2?e+n:e+t));i.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":i.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],i.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":i.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map(((e,r)=>r%2?e+n:e+t));i.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":i.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=o}return i}function ne(e){const t=[];let n="",r=0,o=0,i=0,a=0,s=0,l=0;for(const{key:c,data:d}of e){switch(c){case"M":t.push({key:"M",data:[...d]}),[r,o]=d,[i,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],o=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,o]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,o]});break;case"V":o=d[0],t.push({key:"L",data:[r,o]});break;case"S":{let e=0,i=0;"C"===n||"S"===n?(e=r+(r-s),i=o+(o-l)):(e=r,i=o),t.push({key:"C",data:[e,i,...d]}),s=d[0],l=d[1],r=d[2],o=d[3];break}case"T":{const[e,i]=d;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-s),c=o+(o-l)):(a=r,c=o);const u=r+2*(a-r)/3,p=o+2*(c-o)/3,h=e+2*(a-e)/3,f=i+2*(c-i)/3;t.push({key:"C",data:[u,p,h,f,e,i]}),s=a,l=c,r=e,o=i;break}case"Q":{const[e,n,i,a]=d,c=r+2*(e-r)/3,u=o+2*(n-o)/3,p=i+2*(e-i)/3,h=a+2*(n-a)/3;t.push({key:"C",data:[c,u,p,h,i,a]}),s=e,l=n,r=i,o=a;break}case"A":{const e=Math.abs(d[0]),n=Math.abs(d[1]),i=d[2],a=d[3],s=d[4],l=d[5],c=d[6];0===e||0===n?(t.push({key:"C",data:[r,o,l,c,l,c]}),r=l,o=c):r===l&&o===c||(oe(r,o,l,c,e,n,i,a,s).forEach((function(e){t.push({key:"C",data:e})})),r=l,o=c);break}case"Z":t.push({key:"Z",data:[]}),r=i,o=a}n=c}return t}function re(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function oe(e,t,n,r,o,i,a,s,l,c){const d=(u=a,Math.PI*u/180);var u;let p=[],h=0,f=0,m=0,g=0;if(c)[h,f,m,g]=c;else{[e,t]=re(e,t,-d),[n,r]=re(n,r,-d);const a=(e-n)/2,c=(t-r)/2;let u=a*a/(o*o)+c*c/(i*i);u>1&&(u=Math.sqrt(u),o*=u,i*=u);const p=o*o,y=i*i,v=p*y-p*c*c-y*a*a,b=p*c*c+y*a*a,x=(s===l?-1:1)*Math.sqrt(Math.abs(v/b));m=x*o*c/i+(e+n)/2,g=x*-i*a/o+(t+r)/2,h=Math.asin(parseFloat(((t-g)/i).toFixed(9))),f=Math.asin(parseFloat(((r-g)/i).toFixed(9))),ef&&(h-=2*Math.PI),!l&&f>h&&(f-=2*Math.PI)}let y=f-h;if(Math.abs(y)>120*Math.PI/180){const e=f,t=n,s=r;f=l&&f>h?h+120*Math.PI/180*1:h+120*Math.PI/180*-1,p=oe(n=m+o*Math.cos(f),r=g+i*Math.sin(f),t,s,o,i,a,0,l,[f,e,m,g])}y=f-h;const v=Math.cos(h),b=Math.sin(h),x=Math.cos(f),w=Math.sin(f),k=Math.tan(y/4),_=4/3*o*k,M=4/3*i*k,S=[e,t],E=[e+_*b,t-M*v],z=[n+_*w,r-M*x],C=[n,r];if(E[0]=2*S[0]-E[0],E[1]=2*S[1]-E[1],c)return[E,z,C].concat(p);{p=[E,z,C].concat(p);const e=[];for(let t=0;t2){const o=[];for(let t=0;t2*Math.PI&&(h=0,f=2*Math.PI);const m=2*Math.PI/l.curveStepCount,g=Math.min(m/2,(f-h)/2),y=_e(g,c,d,u,p,h,f,1,l);if(!l.disableMultiStroke){const e=_e(g,c,d,u,p,h,f,1.5,l);y.push(...e)}return a&&(s?y.push(...ve(c,d,c+u*Math.cos(h),d+p*Math.sin(h),l),...ve(c,d,c+u*Math.cos(f),d+p*Math.sin(f),l)):y.push({op:"lineTo",data:[c,d]},{op:"lineTo",data:[c+u*Math.cos(h),d+p*Math.sin(h)]})),{type:"path",ops:y}}function he(e,t){const n=[];if(e.length){const r=t.maxRandomnessOffset||0,o=e.length;if(o>2){n.push({op:"move",data:[e[0][0]+ye(r,t),e[0][1]+ye(r,t)]});for(let i=1;i500?.4:-.0016668*l+1.233334;let d=o.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const u=d/2,p=.2+.2*me(o);let h=o.bowing*o.maxRandomnessOffset*(r-t)/200,f=o.bowing*o.maxRandomnessOffset*(e-n)/200;h=ye(h,o,c),f=ye(f,o,c);const m=[],g=()=>ye(u,o,c),y=()=>ye(d,o,c);return i&&(a?m.push({op:"move",data:[e+g(),t+g()]}):m.push({op:"move",data:[e+ye(d,o,c),t+ye(d,o,c)]})),a?m.push({op:"bcurveTo",data:[h+e+(n-e)*p+g(),f+t+(r-t)*p+g(),h+e+2*(n-e)*p+g(),f+t+2*(r-t)*p+g(),n+g(),r+g()]}):m.push({op:"bcurveTo",data:[h+e+(n-e)*p+y(),f+t+(r-t)*p+y(),h+e+2*(n-e)*p+y(),f+t+2*(r-t)*p+y(),n+y(),r+y()]}),m}function xe(e,t,n){const r=[];r.push([e[0][0]+ye(t,n),e[0][1]+ye(t,n)]),r.push([e[0][0]+ye(t,n),e[0][1]+ye(t,n)]);for(let o=1;o3){const i=[],a=1-n.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+22*Math.PI&&(u=0,p=2*Math.PI);const h=(p-u)/a.curveStepCount,f=[];for(let e=u;e<=p;e+=h)f.push([s+c*Math.cos(e),l+d*Math.sin(e)]);return f.push([s+c*Math.cos(p),l+d*Math.sin(p)]),f.push([s,l]),fe(f,a)}(e,t,n,r,o,i,l));return l.stroke!==Ee&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],o=ce(e,n);if(n.fill&&n.fill!==Ee&&e.length>=3){const t=I(function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(Se(e[0]),Se(e[1]),Se(e[2]),Se(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t{s.length>=4&&i.push(...I(s,t)),s=[]},c=()=>{l(),i.length&&(o.push(i),i=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],i.push(a);break;case"L":l(),i.push([t[0],t[1]]);break;case"C":if(!s.length){const e=i.length?i[i.length-1]:a;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),i.push([a[0],a[1]])}if(c(),!n)return o;const d=[];for(const e of o){const t=D(e,n);t.length&&d.push(t)}return d}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);if(o)if(n.combineNestedSvgPaths){const e=[];s.forEach((t=>e.push(...t))),"solid"===n.fillStyle?r.push(he(e,n)):r.push(fe(e,n))}else s.forEach((e=>{"solid"===n.fillStyle?r.push(he(e,n)):r.push(fe(e,n))}));return i&&(a?s.forEach((e=>{r.push(se(e,!1,n))})):r.push(function(e,t){const n=ne(te(ee(e))),r=[];let o=[0,0],i=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0);r.push({op:"move",data:a.map((n=>n+ye(e,t)))}),i=[a[0],a[1]],o=[a[0],a[1]];break}case"L":r.push(...ve(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[e,n,o,s,l,c]=a;r.push(...Me(e,n,o,s,l,c,i,t)),i=[l,c];break}case"Z":r.push(...ve(i[0],i[1],o[0],o[1],t)),i=[o[0],o[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e){let t="";for(const n of e.ops){const e=n.data;switch(n.op){case"move":t+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":t+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":t+=`L${e[0]} ${e[1]} `}}return t.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Ee};break;case"fillPath":t={d:this.opsToPath(e),stroke:Ee,strokeWidth:0,fill:n.fill||Ee};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Ee,strokeWidth:n,fill:Ee}}}class Ce{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ze(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx;for(const o of t)switch(o.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,o),r.restore();break;case"fillPath":r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,t),r.restore();break;case"fillSketch":this.fillSketch(r,o,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t),e.restore()}_drawToContext(e,t,n="nonzero"){e.beginPath();for(const n of t.ops){const t=n.data;switch(n.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i),i}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i),i}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i),i}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o),o}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,o,i,a=!1,s){const l=this.gen.arc(e,t,n,r,o,i,a,s);return this.draw(l),l}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const Le="http://www.w3.org/2000/svg";class Oe{constructor(e,t){this.svg=e,this.gen=new ze(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,o=r.createElementNS(Le,"g");for(const i of t){let t=null;switch(i.type){case"path":t=r.createElementNS(Le,"path"),t.setAttribute("d",this.opsToPath(i)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(Le,"path"),t.setAttribute("d",this.opsToPath(i)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,i,n)}t&&o.appendChild(t)}return o}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const o=e.createElementNS(Le,"path");return o.setAttribute("d",this.opsToPath(t)),o.setAttribute("stroke",n.fill||""),o.setAttribute("stroke-width",r+""),o.setAttribute("fill","none"),n.fillLineDash&&o.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e){return this.gen.opsToPath(e)}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i)}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i)}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i)}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,o,i,a=!1,s){const l=this.gen.arc(e,t,n,r,o,i,a,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const Te={canvas:(e,t)=>new Ce(e,t),svg:(e,t)=>new Oe(e,t),generator:e=>new ze(e),newSeed:()=>ze.newSeed()};function Ae(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){var n=[e[0],e[e.length-1]],r=n[0],o=n[1];return Fe(r[0],r[1],o[0],o[1])<=s.qx/t}return!1},We=function(e,t,n){var r=e.length;if(r<3)return!1;for(var o=[Number.MAX_SAFE_INTEGER,n],i=[t,n],a=0,s=0;s=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])},Ue=function(e,t,n){var r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},Ze=function(e,t,n,r){var o=Ue(e,t,n),i=Ue(e,t,r),a=Ue(n,r,e),s=Ue(n,r,t);return o!==i&&a!==s||!(0!==o||!Ve(e,n,t))||!(0!==i||!Ve(e,r,t))||!(0!==a||!Ve(n,e,r))||!(0!==s||!Ve(n,t,r))},Ge=function(e,t,n){return n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t]},Xe=function(e,t,n){var r=n.map((function(t){return t[e]})),o=Math.max.apply(Math,r),i=Math.min.apply(Math,r),a=o-i,s=0===a?1:t/a,l=1/0,c=n.map((function(t){return t.map((function(t,n){if(n!==e)return t;var r=t*s;return l=Math.min(r,l),r}))}));if(2===c.length)return c;var d=i-l;return c.map((function(t){return t.map((function(t,n){return n===e?t+d:t}))}))},Ye=function(e){return Ie(e)?et(e):[e.x,e.y,e.x+e.width,e.y+e.height]},Je=function(e){for(var t=0,n=e.sets;t0&&!(e>=r[n].value);n--);return(e/r[n].value).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+r[n].symbol},Pn=function(){var e;return(null===(e=document.querySelector('meta[name="version"]'))||void 0===e?void 0:e.content)||s.eQ},In=function(){return{appearance:"light",collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:s.rk,currentItemFontSize:s.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:it.Sn,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:s.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,height:window.innerHeight,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(w("labels.untitled"),"-").concat(un()),openMenu:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldAddWatermark:!1,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:it.ix,width:window.innerWidth,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1}},Nn={appearance:{browser:!0,export:!1},collaborators:{browser:!1,export:!1},currentChartType:{browser:!0,export:!1},currentItemBackgroundColor:{browser:!0,export:!1},currentItemEndArrowhead:{browser:!0,export:!1},currentItemFillStyle:{browser:!0,export:!1},currentItemFontFamily:{browser:!0,export:!1},currentItemFontSize:{browser:!0,export:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1},currentItemOpacity:{browser:!0,export:!1},currentItemRoughness:{browser:!0,export:!1},currentItemStartArrowhead:{browser:!0,export:!1},currentItemStrokeColor:{browser:!0,export:!1},currentItemStrokeSharpness:{browser:!0,export:!1},currentItemStrokeStyle:{browser:!0,export:!1},currentItemStrokeWidth:{browser:!0,export:!1},currentItemTextAlign:{browser:!0,export:!1},cursorButton:{browser:!0,export:!1},draggingElement:{browser:!1,export:!1},editingElement:{browser:!1,export:!1},editingGroupId:{browser:!0,export:!1},editingLinearElement:{browser:!1,export:!1},elementLocked:{browser:!0,export:!1},elementType:{browser:!0,export:!1},errorMessage:{browser:!1,export:!1},exportBackground:{browser:!0,export:!1},exportEmbedScene:{browser:!0,export:!1},exportWithDarkMode:{browser:!0,export:!1},fileHandle:{browser:!1,export:!1},gridSize:{browser:!0,export:!0},height:{browser:!1,export:!1},isBindingEnabled:{browser:!1,export:!1},isLibraryOpen:{browser:!1,export:!1},isLoading:{browser:!1,export:!1},isResizing:{browser:!1,export:!1},isRotating:{browser:!1,export:!1},lastPointerDownWith:{browser:!0,export:!1},multiElement:{browser:!1,export:!1},name:{browser:!0,export:!1},offsetLeft:{browser:!1,export:!1},offsetTop:{browser:!1,export:!1},openMenu:{browser:!0,export:!1},pasteDialog:{browser:!1,export:!1},previousSelectedElementIds:{browser:!0,export:!1},resizingElement:{browser:!1,export:!1},scrolledOutside:{browser:!0,export:!1},scrollX:{browser:!0,export:!1},scrollY:{browser:!0,export:!1},selectedElementIds:{browser:!0,export:!1},selectedGroupIds:{browser:!0,export:!1},selectionElement:{browser:!1,export:!1},shouldAddWatermark:{browser:!0,export:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1},showHelpDialog:{browser:!1,export:!1},showStats:{browser:!0,export:!1},startBoundElement:{browser:!1,export:!1},suggestedBindings:{browser:!1,export:!1},toastMessage:{browser:!1,export:!1},viewBackgroundColor:{browser:!0,export:!0},width:{browser:!1,export:!1},zenModeEnabled:{browser:!0,export:!1},zoom:{browser:!0,export:!1},viewModeEnabled:{browser:!1,export:!1}},Rn=function(e,t){for(var n={},r=0,o=Object.keys(e);r0?r[n-1]:[0,0],s=a[0],l=a[1];return e+Math.hypot(o-s,i-l)}),0),M=Math.min(k,_/2),S=f-x*M,E=m-w*M;if("dot"===r)return[f,m,Math.hypot(E-m,S-f)];var z={arrow:20,bar:90}[r],C=$e(S,E,f,m,-z*Math.PI/180),L=C[0],O=C[1],T=$e(S,E,f,m,z*Math.PI/180);return[f,m,L,O,T[0],T[1]]}(e,n,r,o);if(null===i)return[];if("dot"===o){var a=i[0],s=i[1],l=i[2];return[t.circle(a,s,l,$n($n({},m),{},{fill:e.strokeColor,fillStyle:"solid"}))]}var c=i[0],d=i[1],u=i[2],p=i[3],h=i[4],f=i[5];return"dotted"===e.strokeStyle?m.strokeLineDash=[3,4]:delete m.strokeLineDash,[t.line(u,p,c,d,m),t.line(h,f,c,d,m)]}if(null!==v){var w=k(e,n,"start",v);n.push.apply(n,w)}null!==x&&(w=k(e,n,"end",x),n.push.apply(n,w))}break;case"text":n=[]}Un.set(e,n)}},Jn=function(e,t){var n=t?t.zoom:Kn.zoom,r=Vn.get(e),o=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||o){var i=function(e,t){var n=document.createElement("canvas"),r=n.getContext("2d"),o=0,i=0;if(Ie(e)){var a=Ye(e),s=a[0],l=a[1],c=a[2],d=a[3];n.width=xn(s,c)*window.devicePixelRatio*t.value+qn*t.value*2,n.height=xn(l,d)*window.devicePixelRatio*t.value+qn*t.value*2,o=e.x>s?Math.floor(xn(e.x,s))*window.devicePixelRatio*t.value:0,i=e.y>l?Math.floor(xn(e.y,l))*window.devicePixelRatio*t.value:0,r.translate(o,i)}else n.width=e.width*window.devicePixelRatio*t.value+qn*t.value*2,n.height=e.height*window.devicePixelRatio*t.value+qn*t.value*2;r.translate(qn*t.value,qn*t.value),r.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);var u=Te.canvas(n);return Wn(e,u,r),r.translate(-20*t.value,-20*t.value),r.scale(1/(window.devicePixelRatio*t.value),1/(window.devicePixelRatio*t.value)),{element:e,canvas:n,canvasZoom:t.value,canvasOffsetX:o,canvasOffsetY:i}}(e,n);return Vn.set(e,i),i}return r},Qn=function(e,t,n,r,o){var i=t.generator;switch(e.type){case"selection":n.translate(e.x+o.scrollX,e.y+o.scrollY);var a=n.fillStyle;n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.fillStyle=a,n.translate(-e.x-o.scrollX,-e.y-o.scrollY);break;case"rectangle":case"diamond":case"ellipse":case"line":case"draw":case"arrow":case"text":if(Yn(e,i),r)!function(e,t,n,r){var o=e.element,i=Ye(o),a=i[0],s=i[1],l=i[2],c=i[3],d=((a+l)/2+r.scrollX)*window.devicePixelRatio,u=((s+c)/2+r.scrollY)*window.devicePixelRatio;n.scale(1/window.devicePixelRatio,1/window.devicePixelRatio),n.translate(d,u),n.rotate(o.angle),n.drawImage(e.canvas,-(l-a)/2*window.devicePixelRatio-qn*e.canvasZoom/e.canvasZoom,-(c-s)/2*window.devicePixelRatio-qn*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.rotate(-o.angle),n.translate(-d,-u),n.scale(window.devicePixelRatio,window.devicePixelRatio)}(Jn(e,o),0,n,o);else{var s=Ye(e),l=s[0],c=s[1],d=s[2],u=s[3],p=(l+d)/2+o.scrollX,h=(c+u)/2+o.scrollY,f=(d-l)/2-(e.x-l),m=(u-c)/2-(e.y-c);n.translate(p,h),n.rotate(e.angle),n.translate(-f,-m),Wn(e,t,n),n.translate(f,m),n.rotate(-e.angle),n.translate(-p,-h)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},er=function(e,t,n,r,o){var i=Ye(e),a=i[0],s=i[1],l=i[2],c=i[3],d=(l-a)/2-(e.x-a),u=(c-s)/2-(e.y-s),p=180*e.angle/Math.PI,h=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":Yn(e,h);var f=t.draw(Zn(e));1!=(y=e.opacity/100)&&(f.setAttribute("stroke-opacity","".concat(y)),f.setAttribute("fill-opacity","".concat(y))),f.setAttribute("transform","translate(".concat(r||0," ").concat(o||0,") rotate(").concat(p," ").concat(d," ").concat(u,")")),n.appendChild(f);break;case"line":case"draw":case"arrow":Yn(e,h);var m=n.ownerDocument.createElementNS(dn,"g"),g=e.opacity/100;Zn(e).forEach((function(n){var i=t.draw(n);1!==g&&(i.setAttribute("stroke-opacity","".concat(g)),i.setAttribute("fill-opacity","".concat(g))),i.setAttribute("transform","translate(".concat(r||0," ").concat(o||0,") rotate(").concat(p," ").concat(d," ").concat(u,")")),"line"!==e.type&&"draw"!==e.type||!He(e.points)||"transparent"===e.backgroundColor||i.setAttribute("fill-rule","evenodd"),m.appendChild(i)})),n.appendChild(m);break;default:if(!Pe(e))throw new Error("Unimplemented type ".concat(e.type));var y=e.opacity/100;f=n.ownerDocument.createElementNS(dn,"g"),1!==y&&(f.setAttribute("stroke-opacity","".concat(y)),f.setAttribute("fill-opacity","".concat(y))),f.setAttribute("transform","translate(".concat(r||0," ").concat(o||0,") rotate(").concat(p," ").concat(d," ").concat(u,")"));for(var v=e.text.replace(/\r\n?/g,"\n").split("\n"),b=e.height/v.length,x=e.height-e.baseline,w="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,k=Ln(e.text)?"rtl":"ltr",_="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===k?"end":"start",M=0;M{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t})()};function sr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t-1&&(i=i.slice(0,a))}if(i.length>0){var s=i[i.length-1];n=vr(s,n,t)}}return n},_r=function(e,t){return e.groupIds.includes(t)},Mr=function(e,t){return e.filter((function(e){return _r(e,t)}))},Sr=function(e,t,n){var r=mr(e),o=n?r.indexOf(n):-1,i=o>-1?o:r.length;return r.splice(i,0,t),r},Er=["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElementIds"];function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){var n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(var r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=Ir(e[r],t+1)}return n}if(Array.isArray(e)){for(var o=e.length,i=new Array(o);o--;)i[o]=Ir(e[o],t+1);return i}return e},Nr=function(e,t,n,r){var o=Ir(n);return o.id=ar(),o.seed=ir(),o.groupIds=function(e,t,n){for(var r=mr(e),o=t?e.indexOf(t):-1,i=o>-1?o:e.length,a=0;a4&&void 0!==arguments[4]?arguments[4]:{},c=Rr[r],d=c/n.value,u=c/n.value,p=c/n.value,h=c/n.value,f=a-o,m=s-i,g=(o+a)/2,y=(i+s)/2,v=4/n.value,b=(c-8)/(2*n.value),x={nw:l.nw?void 0:qr(o-v-p+b,i-v-h+b,d,u,g,y,t),ne:l.ne?void 0:qr(a+v-b,i-v-h+b,d,u,g,y,t),sw:l.sw?void 0:qr(o-v-p+b,s+v-b,d,u,g,y,t),se:l.se?void 0:qr(a+v-b,s+v-b,d,u,g,y,t),rotation:l.rotation?void 0:qr(o+f/2-d/2,i-v-h+b-16/n.value,d,u,g,y,t)},w=5*Rr.mouse/n.value;return Math.abs(f)>w&&(l.n||(x.n=qr(o+f/2-d/2,i-v-h+b,d,u,g,y,t)),l.s||(x.s=qr(o+f/2-d/2,s+v-b,d,u,g,y,t))),Math.abs(m)>w&&(l.w||(x.w=qr(o-v-p+b,i+m/2-u/2,d,u,g,y,t)),l.e||(x.e=qr(a+v-b,i+m/2-u/2,d,u,g,y,t))),x},Hr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"draw"===e.type){if(2===e.points.length){var o=e.points[1];0===o[0]||0===o[1]?r=Kr:o[0]>0&&o[1]<0?r=$r:o[0]>0&&o[1]>0?r=Kr:o[0]<0&&o[1]>0?r=$r:o[0]<0&&o[1]<0&&(r=Kr)}}else"text"===e.type&&(r=jr);return Fr(Ye(e),e.angle,t,n,r)},Wr=function(e,t){return[0,0,0,0,t,e,1,0]},Vr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Ur=function(e){return[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]]},Zr=function(e,t){return no(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]]},Gr=function(e,t){return no(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[Xr(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]]},Xr=function(e,t){return t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6]},Yr=function(e,t){return[Jr(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]]},Jr=function(e,t){return e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0]},Qr=function(e){return Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6]))},eo=function(e){var t=Qr(e);if(0===t||1===t)return e;var n=e[6]<0?-1:1;return Gr(e,n/t)},to=function(e){var t=function(e){return Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1]))}(e);return 0===t||1===t?e:Gr(e,1/t)},no=function(e){return"number"==typeof e},ro=(Vr(1,1),Vr(1,2),Vr(1,3),Vr(1,4),Vr(1,5),Vr(1,6),Vr(1,7),function(e,t,n){return eo([0,n,e,t,0,0,0,0])}),oo=function(e,t){return eo(Yr(t,e))},io=function(e,t){return n=e,[(r=t)[0]*n[0]+r[2]*n[2]+r[3]*n[3]-r[6]*n[6],r[1]*n[0]+r[0]*n[1]-r[4]*n[2]+r[5]*n[3]+r[2]*n[4]-r[3]*n[5]-r[7]*n[6]-r[6]*n[7],r[2]*n[0]+r[0]*n[2]-r[6]*n[3]+r[3]*n[6],r[3]*n[0]+r[6]*n[2]+r[0]*n[3]-r[2]*n[6],r[4]*n[0]+r[7]*n[3]+r[0]*n[4]+r[3]*n[7],r[5]*n[0]+r[7]*n[2]+r[0]*n[5]+r[2]*n[7],r[6]*n[0]+r[0]*n[6],r[7]*n[0]+r[0]*n[7]];var n,r},ao=function(e){var t=e[0];return[0,0,0,0,e[1],t,1,0]},so=function(e){return[e[5],e[4]]},lo=function(e,t){return eo((n=e,[(r=t)[0]*n[0],r[1]*n[0]+r[0]*n[1],r[2]*n[0]+r[0]*n[2],r[3]*n[0]+r[0]*n[3],r[4]*n[0]+r[2]*n[1]-r[1]*n[2]+r[0]*n[4],r[5]*n[0]-r[3]*n[1]+r[1]*n[3]+r[0]*n[5],r[6]*n[0]+r[3]*n[2]-r[2]*n[3]+r[0]*n[6],r[7]*n[0]+r[6]*n[1]+r[5]*n[2]+r[4]*n[3]+r[3]*n[4]+r[2]*n[5]+r[1]*n[6]]));var n,r},co=function(e,t){return Qr(Yr(e,t))},uo=function(e,t){return Jr(e,t)},po=function(e){return[0,0,0,0,e[4],e[5],0,0]},ho=function(e,t){return n=Gr(e,Math.sin(t/2)),r=Math.cos(t/2),no(r)?[n[0]+r,n[1],n[2],n[3],n[4],n[5],n[6],n[7]]:[n[0]+r[0],n[1]+r[1],n[2]+r[2],n[3]+r[3],n[4]+r[4],n[5]+r[5],n[6]+r[6],n[7]+r[7]];var n,r},fo=function(e,t){return eo(Gr(Gr(e,t),Ur(e)))},mo=function(e,t,n,r){var o=10/t.zoom.value;return!go(e,t,[n,r])&&vo(e,[n,r],o)},go=function(e,t,n){var r=10/t.zoom.value,o="text"===e.type?_o:function(e){if("arrow"===e.type)return!1;var t="transparent"!==e.backgroundColor;return"line"===e.type||"draw"===e.type?t&&He(e.points):t}(e)?Mo:So;return wo({element:e,point:n,threshold:r,check:o})},yo=function(e,t){return e.selectedElementIds[t.id]},vo=function(e,t,n){var r=t[0],o=t[1],i=Ye(e),a=i[0],s=i[1],l=i[2],c=i[3],d=$e(r,o,(a+l)/2,(s+c)/2,-e.angle),u=d[0],p=d[1];return u>a-n&&us-n&&p3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"text":case"diamond":var i=Ro(e);r=i.flatMap((function(e,n){var r=[e,i[(n+1)%4]];return Bo(t,jo(r,o))})).concat(i.flatMap((function(e){return Ko(e,o,t)})));break;case"ellipse":r=$o(e,o,t)}if(r.length<2)return[];var a=r.sort((function(e,t){return co(e,n)-co(t,n)}));return[a[0],a[a.length-1]]},Ro=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"text":return[Wr(n,r),Wr(n,-r),Wr(-n,-r),Wr(-n,r)];case"diamond":return[Wr(0,r),Wr(n,0),Wr(0,-r),Wr(-n,0)]}},Bo=function(e,t){var n=t[0],r=t[1];return uo(n,e)*uo(r,e)>=0?[]:[lo(e,oo(n,r))]},jo=function(e,t){var n=e[0],r=e[1],o=function(e,t){var n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]}(function(e,t){return to([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0])}(n,r),t);return[fo(o,n),fo(o,r)]},$o=function(e,t,n){var r=e.width/2+t,o=e.height/2+t,i=n[2],a=n[3],s=n[1],l=r*r*i*i+o*o*a*a,c=l-s*s;if(0===l||c<=0)return[];var d=Math.sqrt(c),u=-r*r*i*s,p=-o*o*a*s;return[Wr((u+r*o*a*d)/l,(p-r*o*i*d)/l),Wr((u-r*o*a*d)/l,(p+r*o*i*d)/l)]},Ko=function(e,t,n){if(0===t)return 0===uo(n,e)?[e]:[];var r=n[2],o=n[3],i=n[1],a=so(e),s=a[0],l=a[1],c=r*r+o*o,d=t*t*c-Math.pow(r*s+o*l+i,2);if(0===c||d<=0)return[];var u=Math.sqrt(d),p=s*o*o-l*r*o-r*i,h=l*r*r-s*r*o-o*i;return[Wr((p+o*u)/c,(h-r*u)/c),Wr((p-o*u)/c,(h+r*u)/c)]},qo=function(e,t,n){var r=Math.abs(t),o=e.width*r/2,i=e.height*r/2,a=Math.sign(t),s=so(n),l=s[0],c=s[1],d=0===c?1e-4:c,u=Math.pow(l,2)*Math.pow(i,2)+Math.pow(d,2)*Math.pow(o,2),p=(-l*Math.pow(i,2)+a*d*Math.sqrt(Math.max(0,u-Math.pow(o,2)*Math.pow(i,2))))/u,h=(-p*l-1)/d,f=-Math.pow(o,2)*p/(Math.pow(h,2)*Math.pow(i,2)+Math.pow(p,2)*Math.pow(o,2));return Wr(f,(-p*f-1)/h)},Fo=function(e,t,n){var r=Math.abs(t),o=Math.sign(t),i=Ro(e,r),a=0,s=null;return i.forEach((function(e){var t=o*oo(n,e)[1];t>a&&(a=t,s=e)})),s},Ho=function(e,t,n,r){for(var o=[],i=!1,a=0,s=Je(e);a=4){if("sharp"===r)return We(o,t,n);var c=I(o,10,5);return We(c,t,n)}return!1},Wo=function(e,t,n,r){var o=Je(e),i=[0,0];return o.some((function(e,o){var a=e.op,s=e.data;if("move"===a)i=s;else if("bcurveTo"===a){var l=[s[0],s[1]],c=[s[2],s[3]],d=[s[4],s[5]],u=i;return i=d,function(e,t,n,r,o,i){for(var a=o[0],s=o[1],l=function(o,i){return Math.pow(1-o,3)*r[i]+3*o*Math.pow(1-o,2)*n[i]+3*Math.pow(o,2)*(1-o)*t[i]+e[i]*Math.pow(o,3)},c=0;c<=1;){var d=l(c,0),u=l(c,1);if(Math.sqrt(Math.pow(d-a,2)+Math.pow(u-s,2))=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3]},Zo=function(e,t,n,r,o,i){return e.reduce((function(e,a){if(e)return e;var s=function(e,t,n,r,o,i){if(!t.selectedElementIds[e.id])return!1;var a=Hr(e,o,i),s=a.rotation,l=fr(a,Vo);if(s&&Uo(s,n,r))return"rotation";var c=Object.keys(l).filter((function(e){var t=l[e];return!!t&&Uo(t,n,r)}));return c.length>0&&c[0]}(a,t,n,r,o,i);return s?{element:a,transformHandleType:s}:null}),null)},Go=function(e,t,n,r,o){var i=e[0],a=e[1],s=e[2],l=e[3],c=Fr([i,a,s,l],0,r,o,Br);return Object.keys(c).find((function(e){var r=c[e];return r&&Uo(r,t,n)}))||!1},Xo=["ns","nesw","ew","nwse"],Yo=function(e){var t=e.element,n=e.transformHandleType,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1,o=null;switch(n){case"n":case"s":o="ns";break;case"w":case"e":o="ew";break;case"nw":case"se":o=r?"nesw":"nwse";break;case"ne":case"sw":o=r?"nwse":"nesw";break;case"rotation":return"grab"}return o&&t&&(o=function(e,t){var n=Xo.indexOf(e);if(n>=0){var r=Math.round(t/(Math.PI/4));e=Xo[(n+r)%Xo.length]}return e}(o,t.angle)),o?"".concat(o,"-resize"):""},Jo=function(){for(var e=0,t=0,n=arguments.length;t-1){!1===c&&n({editingLinearElement:ei(ei({},a),{},{isDragging:!0})});var u=e.createPointAt(d,r-a.pointerOffset.x,o-a.pointerOffset.y,t.gridSize);return e.movePoint(d,s,u),Re(d)&&i(d,0===s?"start":"end"),!0}return!1},e.handlePointerUp=function(t,n,r){var o,i=n.elementId,a=n.activePointIndex,s=n.isDragging,l=e.getElement(i);if(!l)return n;var c={};if(s&&(0===a||a===l.points.length-1)){He(l.points,r.zoom.value)&&e.movePoint(l,a,0===a?l.points[l.points.length-1]:l.points[0]);var d=oi(r)?mi(On(e.getPointAtIndexGlobalCoordinates(l,a)),rr.getScene(l)):null;(o={})[0===a?"startBindingElement":"endBindingElement"]=d,c=o}return ei(ei(ei({},n),c),{},{isDragging:!1,pointerOffset:{x:0,y:0}})},e.handlePointerDown=function(t,n,r,o,i){var a={didAddPoint:!1,hitElement:null};if(!n.editingLinearElement)return a;var s=n.editingLinearElement.elementId,l=e.getElement(s);if(!l)return a;if(t.altKey)return null==n.editingLinearElement.lastUncommittedPoint&&cr(l,{points:Jo(l.points,[e.createPointAt(l,i.x,i.y,n.gridSize)])}),o.resumeRecording(),r({editingLinearElement:ei(ei({},n.editingLinearElement),{},{activePointIndex:l.points.length-1,lastUncommittedPoint:null,endBindingElement:mi(i,rr.getScene(l))})}),a.didAddPoint=!0,a;var c=e.getPointIndexUnderCursor(l,n.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{var d=n.editingLinearElement,u=d.startBindingElement,p=d.endBindingElement;oi(n)&&Re(l)&&ii(l,u,p)}var h=Ye(l),f=h[0],m=h[1],g=(f+h[2])/2,y=(m+h[3])/2,v=c>-1&&$e(l.x+l.points[c][0],l.y+l.points[c][1],g,y,l.angle);return r({editingLinearElement:ei(ei({},n.editingLinearElement),{},{activePointIndex:c>-1?c:null,pointerOffset:v?{x:i.x-v[0],y:i.y-v[1]}:{x:0,y:0}})}),a},e.handlePointerMove=function(t,n,r,o,i){var a=o.elementId,s=o.lastUncommittedPoint,l=e.getElement(a);if(!l)return o;var c=l.points,d=c[c.length-1];if(!t.altKey)return d===s&&e.movePoint(l,c.length-1,"delete"),ei(ei({},o),{},{lastUncommittedPoint:null});var u=e.createPointAt(l,n-o.pointerOffset.x,r-o.pointerOffset.y,i);return d===s?e.movePoint(l,l.points.length-1,u):e.movePoint(l,"new",u),ei(ei({},o),{},{lastUncommittedPoint:l.points[l.points.length-1]})},e.getPointsGlobalCoordinates=function(e){var t=Ye(e),n=t[0],r=t[1],o=t[2],i=t[3],a=(n+o)/2,s=(r+i)/2;return e.points.map((function(t){var n,r=e.x,o=e.y;return[r=(n=$e(r+t[0],o+t[1],a,s,e.angle))[0],o=n[1]]}))},e.getPointAtIndexGlobalCoordinates=function(e,t){var n=t<0?e.points.length+t:t,r=Ye(e),o=r[0],i=r[1],a=(o+r[2])/2,s=(i+r[3])/2,l=e.points[n],c=e.x,d=e.y;return $e(c+l[0],d+l[1],a,s,e.angle)},e.pointFromAbsoluteCoords=function(e,t){var n=Ye(e),r=n[0],o=n[1],i=(r+n[2])/2,a=(o+n[3])/2,s=$e(t[0],t[1],i,a,-e.angle),l=s[0],c=s[1];return[l-e.x,c-e.y]},e.getPointIndexUnderCursor=function(e,t,n,r){for(var o=this.getPointsGlobalCoordinates(e),i=o.length;--i>-1;){var a=o[i];if(Fe(n,r,a[0],a[1])*t.value2)){var i=rr.getScene(e).getElement(n.elementId);if(null!=i){var a,s="start"===t?-1:1,l=-1===s?0:e.points.length-1,c=l-s,d=ti.getPointAtIndexGlobalCoordinates(e,c),u=function(e,t,n){if(0===t){var r=Ye(e),o=Po(r);return so(o)}var i,a=Do(e),s=fo(a,ao(n)),l=Ur(a);switch(e.type){case"rectangle":case"text":case"diamond":i=Fo(e,t,s);break;case"ellipse":i=qo(e,t,s)}return so(fo(l,i))}(i,n.focus,d);if(0===n.gap)a=u;else{var p=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=Do(e),i=fo(o,ao(t)),a=fo(o,ao(n)),s=oo(i,a),l=Ur(o);return No(e,s,i,r).map((function(e){return so(fo(l,e))}))}(i,d,u,n.gap);a=0===p.length?u:p[0]}ti.movePoint(e,l,ti.pointFromAbsoluteCoords(e,a),((o={})["start"===t?"startBinding":"endBinding"]=n,o))}}},wi=function(e,t,n){if(null==t||null==n)return t;var r=t.gap,o=t.focus,i=t.elementId,a=n.width,s=n.height,l=e.width,c=e.height;return{elementId:i,gap:Math.max(1,Math.min(xo(e,a,s),r*(a0&&(t.forEach((function(e){a&&!n.has(e)&&o.add(e)})),i.add(n.get(e.id))),Re(e)){if(null!=e.startBinding){var r=e.startBinding.elementId;a&&!n.has(r)&&i.add(r)}null!=e.endBinding&&(r=e.endBinding.elementId,a&&!n.has(r)&&i.add(r)),null==e.startBinding&&null==e.endBinding||o.add(n.get(e.id))}})),e.filter((function(e){var t=e.id;return o.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;cr(e,{startBinding:Ci(t,n),endBinding:Ci(r,n)})})),e.filter((function(e){var t=e.id;return i.has(t)})).forEach((function(e){var t=e.boundElementIds;null!=t&&t.length>0&&cr(e,{boundElementIds:t.map((function(e){var t;return null!==(t=n.get(e))&&void 0!==t?t:e}))})}))},Ci=function(e,t){var n;if(null==e)return null;var r=e.elementId;return{focus:e.focus,gap:e.gap,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},Li=function(e,t){var n=new Set(t.map((function(e){return e.id}))),r=new Set;t.forEach((function(e){var t;je(e)&&(null===(t=e.boundElementIds)||void 0===t||t.forEach((function(e){n.has(e)||r.add(e)})))})),e.filter((function(e){var t=e.id;return r.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;cr(e,{startBinding:Oi(t,n),endBinding:Oi(r,n)})}))},Oi=function(e,t){return null==e||t.has(e.elementId)?null:e},Ti=function(){for(var e=0,t=0,n=arguments.length;t=2*Math.PI?e-2*Math.PI:e},Ii=function(e,t,n,r){var o=Ye(e),i=o[0],a=o[1],l=(i+o[2])/2,c=(a+o[3])/2,d=5*Math.PI/2+Math.atan2(n-c,t-l);r&&(d+=s.ay/2,d-=d%s.ay),d=Pi(d),cr(e,{angle:d})},Ni=function(e,t,n,r,o){var i,a=Ye(e),s=a[0],l=a[1],c=a[2],d=a[3],u=$e(r,o,(s+c)/2,(l+d)/2,-e.angle),p=u[0],h=u[1],f="end"===t?[p-e.x,h-e.y]:[e.x+e.points[1][0]-p,e.y+e.points[1][1]-h],m=f[0],g=f[1];n&&(m=(i=function(e,t,n,r){var o=pr.apply(void 0,Ti([e],$e(t,n,0,0,r)));return $e(o.width,o.height,0,0,-r)}(e.type,m,g,e.angle))[0],g=i[1]);var y=qe("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-m)/2,(e.points[1][1]-g)/2),v=y[0],b=y[1];cr(e,{x:v,y:b,points:[[0,0],[m,g]]})},Ri=function(e,t,n){return Ie(e)?{points:Xe(0,t,Xe(1,n,e.points))}:{}},Bi=function(e,t,n){var r=e.fontSize*(t/e.width);if(r<1)return null;var o=gn(e.text,mn({fontSize:r,fontFamily:e.fontFamily}));return{size:r,baseline:o.baseline+(n-o.height)}},ji=function(e,t,n,r,o){var i,a=Ye(e),s=a[0],l=a[1],c=a[2],d=a[3],u=$e(r,o,(s+c)/2,(l+d)/2,-e.angle),p=u[0],h=u[1];switch(t){case"se":i=Math.max((p-s)/(c-s),(h-l)/(d-l));break;case"nw":i=Math.max((c-p)/(c-s),(d-h)/(d-l));break;case"ne":i=Math.max((p-s)/(c-s),(d-h)/(d-l));break;case"sw":i=Math.max((c-p)/(c-s),(h-l)/(d-l))}if(i>0){var f=e.width*i,m=e.height*i,g=Bi(e,f,m);if(null===g)return;var y=rt(e,f,m),v=(s-y[0])/2,b=(l-y[1])/2,x=(c-y[2])/2,w=(d-y[3])/2,k=qe(function(e,t){return{n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}}(t,n),e.x,e.y,e.angle,v,b,x,w),_=k[0],M=k[1];cr(e,{fontSize:g.size,width:f,height:m,baseline:g.baseline,x:_,y:M})}},$i=function(e,t,n,r,o,i,a){var s,l,c=rt(e,e.width,e.height),d=[c[0],c[1]],u=[c[2],c[3]],p=[((s=d)[0]+(l=u)[0])/2,(s[1]+l[1])/2],h=Ke([i,a],p,-e.angle),f=rt(n,n.width,n.height),m=f[0],g=f[1],y=f[2]-m,v=f[3]-g,b=(u[0]-d[0])/y,x=(u[1]-d[1])/v;r.includes("e")&&(b=(h[0]-d[0])/y),r.includes("s")&&(x=(h[1]-d[1])/v),r.includes("w")&&(b=(u[0]-h[0])/y),r.includes("n")&&(x=(u[1]-h[1])/v);var w=e.width,k=e.height,_=n.width*b,M=n.height*x;if(o&&(_=2*_-w,M=2*M-k),t){var S=Math.abs(_)/w,E=Math.abs(M)/k;if(1===r.length&&(M*=S,_*=E),2===r.length){var z=Math.max(S,E);_=w*z*Math.sign(_),M=k*z*Math.sign(M)}}var C=rt(e,_,M),L=C[0],O=C[1],T=C[2]-L,A=C[3]-O,D=Ti(d);if(["n","w","nw"].includes(r)&&(D=[u[0]-Math.abs(T),u[1]-Math.abs(A)]),"ne"===r){var P=[d[0],u[1]];D=[P[0],P[1]-Math.abs(A)]}if("sw"===r){var I=[u[0],d[1]];D=[I[0]-Math.abs(T),I[1]]}t&&(["s","n"].includes(r)&&(D[0]=p[0]-T/2),["e","w"].includes(r)&&(D[1]=p[1]-A/2)),_<0&&(r.includes("e")&&(D[0]-=Math.abs(T)),r.includes("w")&&(D[0]+=Math.abs(T))),M<0&&(r.includes("s")&&(D[1]-=Math.abs(A)),r.includes("n")&&(D[1]+=Math.abs(A))),o&&(D[0]=p[0]-Math.abs(T)/2,D[1]=p[1]-Math.abs(A)/2);var N=e.angle,R=Ke(D,p,N),B=[D[0]+Math.abs(T)/2,D[1]+Math.abs(A)/2],j=Ke(B,p,N);D=Ke(R,j,-N);var $=Ri(e,_,M),K=Ti(D);K[0]+=e.x-L,K[1]+=e.y-O;var q=Di({width:Math.abs(_),height:Math.abs(M),x:K[0],y:K[1]},$);0!==q.width&&0!==q.height&&Number.isFinite(q.x)&&Number.isFinite(q.y)&&(yi(n,{newSize:{width:q.width,height:q.height}}),cr(n,q))},Ki=function(e,t,n,r){var o,i,a=nt(e),s=a[0],l=a[1],c=a[2],d=a[3];switch(t){case"se":o=Math.max((n-s)/(c-s),(r-l)/(d-l)),i=function(e,t,n){var r=t[0],i=t[1],a=n[0],c=n[1];return{x:e.x+(r-s)*(o-1)+r-a,y:e.y+(i-l)*(o-1)+i-c}};break;case"nw":o=Math.max((c-n)/(c-s),(d-r)/(d-l)),i=function(e,t,n){var r=t[2],i=t[3],a=n[2],s=n[3];return{x:e.x-(c-r)*(o-1)+r-a,y:e.y-(d-i)*(o-1)+i-s}};break;case"ne":o=Math.max((n-s)/(c-s),(d-r)/(d-l)),i=function(e,t,n){var r=t[0],i=t[3],a=n[0],l=n[3];return{x:e.x+(r-s)*(o-1)+r-a,y:e.y-(d-i)*(o-1)+i-l}};break;case"sw":o=Math.max((c-n)/(c-s),(r-l)/(d-l)),i=function(e,t,n){var r=t[1],i=t[2],a=n[1],s=n[2];return{x:e.x-(c-i)*(o-1)+i-s,y:e.y+(r-l)*(o-1)+r-a}}}if(o>0){var u=e.reduce((function(t,n){if(!t)return t;var r=n.width*o,a=n.height*o,s={};if("text"===n.type){var l=Bi(n,r,a);if(null===l)return null;s={fontSize:l.size,baseline:l.baseline}}var c=Ye(n),d=Ri(n,r,a);yi(n,{newSize:{width:r,height:a},simultaneouslyUpdated:e});var u=rt(Di(Di({},n),d),r,a),p=i(n,c,u),h=p.x,f=p.y;return Ti(t,[Di(Di({width:r,height:a,x:h,y:f},d),s)])}),[]);u&&e.forEach((function(e,t){cr(e,u[t])}))}},qi=function(e,t,n,r,o,i,a){var l=5*Math.PI/2+Math.atan2(r-a,n-i);o&&(l+=s.ay/2,l-=l%s.ay),t.forEach((function(t,n){var r,o,s=Ye(t),c=s[0],d=s[1],u=(c+s[2])/2,p=(d+s[3])/2,h=null!==(r=null===(o=e.originalElements.get(t.id))||void 0===o?void 0:o.angle)&&void 0!==r?r:t.angle,f=$e(u,p,i,a,l+h-t.angle),m=f[0],g=f[1];cr(t,{x:t.x+(m-u),y:t.y+(g-p),angle:Pi(l+h)})}))},Fi=function(e,t,n,r,o,i,a,s,l,c){var d;l&&(a=(d=pr(t,a,ie.width||p-c>e.height}(t,0,[i,a,s,l])&&(i=(r=function(e,t){if(!e.length)return[0,0,0,0];var n=1/0,r=e[0];return e.forEach((function(e){var o=tt(e),i=o[0],a=o[1],s=o[2],l=o[3],c=Fe((i+s)/2,(a+l)/2,t.x,t.y);c=0;--r){var o=e[r];if(!o.isDeleted&&t(o)){n=o;break}}return n},ya=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},va=function(e){var t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,10))},ba=(n(9478),a().forwardRef((function(e,t){var n=a().useRef(null);a().useImperativeHandle(t,(function(){return n.current}));var r="ToolIcon_size_".concat(e.size||"m");return"button"===e.type?a().createElement("button",{className:De("ToolIcon_type_button",r,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected}),hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:"button",onClick:e.onClick,ref:n},a().createElement("div",{className:"ToolIcon__icon","aria-hidden":"true"},e.icon||e.label,e.keyBindingLabel&&a().createElement("span",{className:"ToolIcon__keybinding"},e.keyBindingLabel)),e.showAriaLabel&&a().createElement("div",{className:"ToolIcon__label"},e["aria-label"]),e.children):a().createElement("label",{className:De("ToolIcon",e.className),title:e.title},a().createElement("input",{className:"ToolIcon_type_radio ".concat(r),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:e.id,onChange:e.onChange,checked:e.checked,ref:n}),a().createElement("div",{className:"ToolIcon__icon"},e.icon,e.keyBindingLabel&&a().createElement("span",{className:"ToolIcon__keybinding"},e.keyBindingLabel)))})));ba.defaultProps={visible:!0,className:""};var xa=function(e){return"light"===e?it.$y[4]:it.$y[9]},wa=function(e){return"light"===e?it.Sn:it.MA[4]},ka=function(e){return"light"===e?it.ix:"#1e1e1e"},_a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512,n="number"==typeof t?{width:t}:t,r=n.width,o=void 0===r?512:r,i=n.height,s=void 0===i?o:i,l=n.mirror,c=n.style;return a().createElement("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(o," ").concat(s),className:De({"rtl-mirror":l}),style:c},"string"==typeof e?a().createElement("path",{fill:"currentColor",d:e}):e)},Ma=(_a("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),_a("M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z",{width:448,height:512})),Sa=_a("M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z",{width:448,height:512}),Ea=_a("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),za=(_a("M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z",{width:384,height:512}),_a("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512})),Ca=_a("M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"),La=_a("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),Oa=_a("M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),Ta=_a("M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z",{width:448,height:512}),Aa=_a("M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"),Da=_a("M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"),Pa=_a("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),Ia=_a("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),Na=_a("M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z",{mirror:!0}),Ra=_a(a().createElement("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),Ba=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:wa(t),stroke:wa(t),strokeWidth:"2"}),a().createElement("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24,mirror:!0})})),ja=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:xa(t),stroke:xa(t),strokeWidth:"2"}),a().createElement("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:wa(t),stroke:wa(t),strokeWidth:"2"})),{width:24,mirror:!0})})),$a=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:wa(t),stroke:wa(t),strokeWidth:"2"}),a().createElement("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24,mirror:!0})})),Ka=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:xa(t),stroke:xa(t),strokeLinejoin:"round",strokeWidth:"2"}),a().createElement("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:wa(t),stroke:wa(t),strokeLinejoin:"round",strokeWidth:"2"})),{width:24,mirror:!0})})),qa=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M 2,5 H 22",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeLinecap:"round"}),a().createElement("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24,mirror:!0})})),Fa=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M 2,19 H 22",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeLinecap:"round"}),a().createElement("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24,mirror:!0})})),Ha=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M 5,2 V 22",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeLinecap:"round"}),a().createElement("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24})})),Wa=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M 19,2 V 22",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeLinecap:"round"}),a().createElement("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24})})),Va=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M5 5V19Z",fill:"black"}),a().createElement("path",{d:"M19 5V19M5 5V19",stroke:wa(t),strokeWidth:"2",strokeLinecap:"round"}),a().createElement("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24})})),Ua=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M5 5L19 5M5 19H19",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeLinecap:"round"}),a().createElement("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:xa(t),stroke:xa(t),strokeWidth:"2"})),{width:24})})),Za=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:xa(t),stroke:xa(t),strokeWidth:"2"}),a().createElement("path",{d:"M 2,12 H 22",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})),{width:24,mirror:!0})})),Ga=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:xa(t),stroke:xa(t),strokeWidth:"2"}),a().createElement("path",{d:"M 12,2 V 22",fill:wa(t),stroke:wa(t),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})),{width:24})})),Xa=(_a("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),_a("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z"),_a("M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z"),_a("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),Ya=_a("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),Ja=_a("M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z",{mirror:!0}),Qa=(_a("M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z",{width:24}),a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M25 26H111V111H25",fill:wa(t)}),a().createElement("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:wa(t),strokeWidth:"2"}),a().createElement("path",{d:"M100 100H160V160H100",fill:wa(t)}),a().createElement("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:wa(t),strokeWidth:"2"}),a().createElement("rect",{x:"2.5",y:"2.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"2.5",y:"149.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"147.5",y:"149.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"147.5",y:"2.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"})),{width:182,height:182,mirror:!0})}))),es=a().memo((function(e){var t=e.appearance;return _a(a().createElement(a().Fragment,null,a().createElement("path",{d:"M25 26H111V111H25",fill:wa(t)}),a().createElement("path",{d:"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z",stroke:wa(t),strokeWidth:"2"}),a().createElement("path",{d:"M100 100H160V160H100",fill:wa(t)}),a().createElement("path",{d:"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z",stroke:wa(t),strokeWidth:"2"}),a().createElement("rect",{x:"2.5",y:"2.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"78.5",y:"149.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"147.5",y:"149.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"147.5",y:"78.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"105.5",y:"2.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"}),a().createElement("rect",{x:"2.5",y:"102.5",width:"30",height:"30",fill:ka(t),stroke:wa(t),strokeWidth:"6"})),{width:182,height:182,mirror:!0})})),ts=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:wa(t)}),{width:40,height:20})})),ns=a().memo((function(e){var t=e.appearance;return _a(a().createElement("g",{fill:wa(t),fillRule:"evenodd",clipRule:"evenodd"},a().createElement("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),a().createElement("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})),{width:40,height:20})})),rs=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M2 2H38V18H2V2Z",fill:wa(t)}),{width:40,height:20})})),os=a().memo((function(e){var t=e.appearance,n=e.strokeWidth;return _a(a().createElement("path",{d:"M6 10H34",stroke:wa(t),strokeWidth:n,fill:"none"}),{width:40,height:20})})),is=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M6 10H34",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20})})),as=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M6 10H34",stroke:wa(t),strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none"}),{width:40,height:20})})),ss=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M6 10H34",stroke:wa(t),strokeWidth:2.5,strokeDasharray:"4, 4",fill:"none"}),{width:40,height:20})})),ls=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20,mirror:!0})})),cs=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20,mirror:!0})})),ds=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20,mirror:!0})})),us=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M10 17L10 5L35 5",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20,mirror:!0})})),ps=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20,mirror:!0})})),hs=a().memo((function(e){var t=e.appearance;return _a(a().createElement("path",{d:"M6 10H34",stroke:wa(t),strokeWidth:2,fill:"none"}),{width:40,height:20})})),fs=a().memo((function(e){var t=e.appearance,n=e.flip,r=void 0!==n&&n;return _a(a().createElement("g",{transform:r?"translate(40, 0) scale(-1, 1)":"",stroke:wa(t),strokeWidth:2,fill:"none"},a().createElement("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),a().createElement("path",{d:"M27.5 5L34.5 10L27.5 15"})),{width:40,height:20})})),ms=a().memo((function(e){var t=e.appearance,n=e.flip,r=void 0!==n&&n;return _a(a().createElement("g",{stroke:wa(t),fill:wa(t),transform:r?"translate(40, 0) scale(-1, 1)":""},a().createElement("path",{d:"M32 10L6 10",strokeWidth:2}),a().createElement("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})),{width:40,height:20})})),gs=a().memo((function(e){var t=e.appearance,n=e.flip,r=void 0!==n&&n;return _a(a().createElement("g",{transform:r?"translate(40, 0) scale(-1, 1)":""},a().createElement("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:wa(t),strokeWidth:2,fill:"none"})),{width:40,height:20})})),ys=[],vs=function(e){return ys=ys.concat(e),e};function bs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xs(e){for(var t=1;t0?o-1:0})}),commitToHistory:!0}}var d=function(e,t){return{elements:e.map((function(e){return t.selectedElementIds[e.id]?dr(e,{isDeleted:!0}):e})),appState:xs(xs({},t),{},{selectedElementIds:{}})}}(e,t),u=d.elements,p=d.appState;return Li(u,e.filter((function(e){var n=e.id;return t.selectedElementIds[n]}))),{elements:u,appState:xs(xs({},p=ws(p,u)),{},{elementType:"selection",multiElement:null}),commitToHistory:aa(Qi(e),t)}},contextItemLabel:"labels.delete",keyTest:function(e){return e.key===Nt||e.key===jt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{type:"button",icon:za,title:w("labels.delete"),"aria-label":w("labels.delete"),onClick:function(){return r(null)},visible:aa(Qi(t),n)})}}),_s=function(){for(var e=0,t=0,n=arguments.length;t2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length-1,Math.max(n,0)))+1;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,i,Math.max(0,n-1)):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length,Math.max(n,0)))-1;++r0&&r[n-1]!==t-1&&(o=++o),(e[o]||(e[o]=[])).push(t),e}),[]));return"right"===n&&(a=a.reverse()),a.forEach((function(r,o){var i=r[0],a=r[r.length-1],s="left"===n?i:a,l=Ss(e,t,s,n);if(-1!==l&&s!==l){var c="left"===n?t.slice(0,l):t.slice(0,i),d=t.slice(i,a+1),u="left"===n?t.slice(l,i):t.slice(a+1,l+1),p="left"===n?t.slice(a+1):t.slice(l+1);t="left"===n?_s(c,d,u,p):_s(c,u,d,p)}})),t},zs=function(e,t,n){var r,o,i=Ms(e,t),a=[],s=[];if("left"===n){if(t.editingGroupId){if(!(l=Mr(e,t.editingGroupId)).length)return e;r=e.indexOf(l[0])}else r=0;o=i[i.length-1]}else{if(t.editingGroupId){var l;if(!(l=Mr(e,t.editingGroupId)).length)return e;o=e.indexOf(l[l.length-1])}else o=e.length-1;r=i[0]}for(var c=r;ca&&(e.style.left="".concat(a-o,"px"));var s=window.innerHeight;r+i>s&&(e.style.top="".concat(s-i,"px"))}}),[l]),(0,i.useEffect)((function(){if(o){var e=function(e){var t;null!==(t=c.current)&&void 0!==t&&t.contains(e.target)||(0,ct.unstable_batchedUpdates)((function(){return o(e)}))};return document.addEventListener("pointerdown",e,!1),function(){return document.removeEventListener("pointerdown",e,!1)}}}),[o]),a().createElement("div",{className:"popover",style:{top:r,left:n},ref:c},t)}),Us=(n(5574),function(e){var t=(new Option).style;return t.color=e,!!t.color}),Zs=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Gs=function(e){var t=e.colors,n=e.color,r=e.onChange,o=e.onClose,i=e.label,s=e.showInput,l=void 0===s||s,c=e.type,d=a().useRef(),u=a().useRef(),p=a().useRef(),h=a().useRef();return a().useEffect((function(){u.current?u.current.focus():h.current?h.current.focus():p.current&&p.current.focus()}),[]),a().createElement("div",{className:"color-picker color-picker-type-".concat(c),role:"dialog","aria-modal":"true","aria-label":w("labels.colorPicker"),onKeyDown:function(e){if(e.key===Ht){var t,n=document.activeElement;if(e.shiftKey)n===d.current&&(null===(t=h.current)||void 0===t||t.focus(),e.preventDefault());else if(n===h.current){var r;null===(r=d.current)||void 0===r||r.focus(),e.preventDefault()}}else if(an(e.key)){n=document.activeElement;var i=b().rtl;if(-1!==(c=Array.prototype.indexOf.call(p.current.children,n))){var a=p.current.children.length-(l?1:0),s=e.key===(i?Dt:Pt)?(c+1)%a:e.key===(i?Pt:Dt)?(a+c-1)%a:e.key===At?(c+5)%a:e.key===It?(a+c-5)%a:c;p.current.children[s].focus()}e.preventDefault()}else if(Zs.includes(e.key.toLowerCase())&&!hn(e.target)){var c=Zs.indexOf(e.key.toLowerCase());p.current.children[c].focus(),e.preventDefault()}else e.key!==Kt&&e.key!==$t||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation()}},a().createElement("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),a().createElement("div",{className:"color-picker-triangle"}),a().createElement("div",{className:"color-picker-content",ref:function(e){e&&(p.current=e)},tabIndex:0},t.map((function(e,t){return a().createElement("button",{className:"color-picker-swatch",onClick:function(t){t.currentTarget.focus(),r(e)},title:"".concat(e," — ").concat(Zs[t].toUpperCase()),"aria-label":e,"aria-keyshortcuts":Zs[t],style:{color:e},key:e,ref:function(r){r&&0===t&&(d.current=r),r&&e===n&&(u.current=r)},onFocus:function(){r(e)}},"transparent"===e?a().createElement("div",{className:"color-picker-transparent"}):void 0,a().createElement("span",{className:"color-picker-keybinding"},Zs[t]))})),l&&a().createElement(Xs,{color:n,label:i,onChange:function(e){r(e)},ref:h})))},Xs=a().forwardRef((function(e,t){var n=e.color,r=e.onChange,o=e.label,i=a().useState(n),s=i[0],l=i[1],c=a().useRef(null);a().useEffect((function(){l(n)}),[n]),a().useImperativeHandle(t,(function(){return c.current}));var d=a().useCallback((function(e){var t=e.toLowerCase(),n=function(e){return"transparent"===e||Us(e)?e:Us("#".concat(e))?"#".concat(e):null}(t);n&&r(n),l(t)}),[r]);return a().createElement("label",{className:"color-input-container"},a().createElement("div",{className:"color-picker-hash"},"#"),a().createElement("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:function(e){return d(e.target.value)},value:(s||"").replace(/^#/,""),onBlur:function(){return l(n)},ref:c}))})),Ys=function(e){var t=e.type,n=e.color,r=e.onChange,o=e.label,i=a().useState(!1),s=i[0],l=i[1],c=a().useRef(null);return a().createElement("div",null,a().createElement("div",{className:"color-picker-control-container"},a().createElement("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:function(){return l(!s)},ref:c}),a().createElement(Xs,{color:n,label:o,onChange:function(e){r(e)}})),a().createElement(a().Suspense,{fallback:""},s?a().createElement(Vs,{onCloseRequest:function(e){return e.target!==c.current&&l(!1)}},a().createElement(Gs,{colors:lt[t],color:n||null,onChange:function(e){r(e)},onClose:function(){var e;l(!1),null===(e=c.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})):null))};function Js(){return(Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&t>0&&o(t-10)},value:null!==(t=ol(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0}))}}),vs({name:"changeFontSize",perform:function(e,t,n){return{elements:rl(e,t,(function(e){if(Pe(e)){var t=dr(e,{fontSize:n});return Vi(t),t}return e})),appState:nl(nl({},t),{},{currentItemFontSize:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement("fieldset",null,a().createElement("legend",null,w("labels.fontSize")),a().createElement(Ws,{group:"font-size",options:[{value:16,text:w("labels.small")},{value:20,text:w("labels.medium")},{value:28,text:w("labels.large")},{value:36,text:w("labels.veryLarge")}],value:ol(t,n,(function(e){return Pe(e)&&e.fontSize}),n.currentItemFontSize||s.n5),onChange:function(e){return r(e)}}))}}),vs({name:"changeFontFamily",perform:function(e,t,n){return{elements:rl(e,t,(function(e){if(Pe(e)){var t=dr(e,{fontFamily:n});return Vi(t),t}return e})),appState:nl(nl({},t),{},{currentItemFontFamily:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=[{value:1,text:w("labels.handDrawn")},{value:2,text:w("labels.normal")},{value:3,text:w("labels.code")}];return a().createElement("fieldset",null,a().createElement("legend",null,w("labels.fontFamily")),a().createElement(Ws,{group:"font-family",options:o,value:ol(t,n,(function(e){return Pe(e)&&e.fontFamily}),n.currentItemFontFamily||s.rk),onChange:function(e){return r(e)}}))}}),vs({name:"changeTextAlign",perform:function(e,t,n){return{elements:rl(e,t,(function(e){if(Pe(e)){var t=dr(e,{textAlign:n});return Vi(t),t}return e})),appState:nl(nl({},t),{},{currentItemTextAlign:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement("fieldset",null,a().createElement("legend",null,w("labels.textAlign")),a().createElement(Ws,{group:"text-align",options:[{value:"left",text:w("labels.left")},{value:"center",text:w("labels.center")},{value:"right",text:w("labels.right")}],value:ol(t,n,(function(e){return Pe(e)&&e.textAlign}),n.currentItemTextAlign),onChange:function(e){return r(e)}}))}}),vs({name:"changeSharpness",perform:function(e,t,n){var r=la(Qi(e),t),o=r.length?r.every((function(e){return!Ie(e)})):!Ne(t.elementType),i=r.length?r.every(Ie):Ne(t.elementType);return{elements:rl(e,t,(function(e){return dr(e,{strokeSharpness:n})})),appState:nl(nl({},t),{},{currentItemStrokeSharpness:o?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:i?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement("fieldset",null,a().createElement("legend",null,w("labels.edges")),a().createElement(Hs,{group:"edges",options:[{value:"sharp",text:w("labels.sharp"),icon:a().createElement(us,{appearance:n.appearance})},{value:"round",text:w("labels.round"),icon:a().createElement(ps,{appearance:n.appearance})}],value:ol(t,n,(function(e){return e.strokeSharpness}),ha(n.elementType)&&(Ne(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}}))}}),vs({name:"changeArrowhead",perform:function(e,t,n){var r;return{elements:rl(e,t,(function(e){if(Ie(e)){var t=n.position,r=n.type;if("start"===t)return dr(e,{startArrowhead:r});if("end"===t)return dr(e,{endArrowhead:r})}return e})),appState:nl(nl({},t),{},(r={},r["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]=n.type,r)),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=b().rtl;return a().createElement("fieldset",null,a().createElement("legend",null,w("labels.arrowheads")),a().createElement("div",{className:"iconSelectList"},a().createElement(el,{label:"arrowhead_start",options:[{value:null,text:w("labels.arrowhead_none"),icon:a().createElement(hs,{appearance:n.appearance}),keyBinding:"q"},{value:"arrow",text:w("labels.arrowhead_arrow"),icon:a().createElement(fs,{appearance:n.appearance,flip:!o}),keyBinding:"w"},{value:"bar",text:w("labels.arrowhead_bar"),icon:a().createElement(gs,{appearance:n.appearance,flip:!o}),keyBinding:"e"},{value:"dot",text:w("labels.arrowhead_dot"),icon:a().createElement(ms,{appearance:n.appearance,flip:!o}),keyBinding:"r"}],value:ol(t,n,(function(e){return Ie(e)&&ma(e.type)?e.startArrowhead:n.currentItemStartArrowhead}),n.currentItemStartArrowhead),onChange:function(e){return r({position:"start",type:e})}}),a().createElement(el,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:w("labels.arrowhead_none"),keyBinding:"q",icon:a().createElement(hs,{appearance:n.appearance})},{value:"arrow",text:w("labels.arrowhead_arrow"),keyBinding:"w",icon:a().createElement(fs,{appearance:n.appearance,flip:o})},{value:"bar",text:w("labels.arrowhead_bar"),keyBinding:"e",icon:a().createElement(gs,{appearance:n.appearance,flip:o})},{value:"dot",text:w("labels.arrowhead_dot"),keyBinding:"r",icon:a().createElement(ms,{appearance:n.appearance,flip:o})}],value:ol(t,n,(function(e){return Ie(e)&&ma(e.type)?e.endArrowhead:n.currentItemEndArrowhead}),n.currentItemEndArrowhead),onChange:function(e){return r({position:"end",type:e})}})))}}),n(2189)),al=n.n(il),sl=a().createContext(!1),ll=function(){return window.matchMedia?window.matchMedia(al().isMobileQuery):{matches:!1,addListener:function(){},removeListener:function(){}}},cl=function(e){var t=e.children,n=(0,i.useRef)();n.current||(n.current=ll());var r=(0,i.useState)(n.current.matches),o=r[0],s=r[1];return(0,i.useEffect)((function(){var e=function(){return s(n.current.matches)};return n.current.addListener(e),function(){return n.current.removeListener(e)}}),[]),a().createElement(sl.Provider,{value:o},t)},dl=function(){return ll().matches};function ul(){return(0,i.useContext)(sl)}function pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hl(e){for(var t=1;t0?nt(o):nt(r),a=function(e,t){var n=e[0],r=e[1],o=e[2],i=e[3],a=o-n,l=t.width/a,c=i-r,d=t.height/c,u=Math.min(l,d),p=Math.floor(u/s.V4)*s.V4;return Math.min(Math.max(p,s.V4),1)}(i,{width:t.width,height:t.height}),l=ya(a,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),c=i[0],d=i[1],u=(c+i[2])/2,p=(d+i[3])/2;return{appState:hl(hl(hl({},t),ca({scenePoint:{x:u,y:p},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{},{zoom:l}),commitToHistory:!1}};function ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gl(e){for(var t=1;t1){var g=ti.getPointAtIndexGlobalCoordinates(d,-1),y=g[0],v=g[1];ci(d,t,rr.getScene(d),{x:y,y:v})}t.elementLocked||"draw"===t.elementType||(t.selectedElementIds[d.id]=!0)}return(t.elementLocked||"draw"===t.elementType)&&d||wn(),{elements:c,appState:gl(gl({},t),{},{elementType:(t.elementLocked||"draw"===t.elementType)&&d?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:d&&!t.elementLocked&&"draw"!==t.elementType?gl(gl({},t.selectedElementIds),{},(n={},n[d.id]=!0,n)):t.selectedElementIds}),commitToHistory:"draw"===t.elementType}},keyTest:function(e,t){return e.key===Kt&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Kt||e.key===$t)&&null!==t.multiElement},PanelComponent:function(e){var t=e.appState,n=e.updateData;return a().createElement(ba,{type:"button",icon:Aa,title:w("buttons.done"),"aria-label":w("buttons.done"),onClick:n,visible:null!=t.multiElement})}}),vl=(n(8518),function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),bl=function(e){function t(){var t,n=this;return n=e.apply(this,arguments)||this,t=n,n.handleFocus=function(e){vn(e.currentTarget)},n.handleBlur=function(e){var n=e.currentTarget.innerText.trim();n!==t.props.value&&t.props.onChange(n),bn()},n.handleKeyDown=function(e){if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},n.makeEditable=function(e){if(e)try{e.contentEditable="plaintext-only"}catch(t){e.contentEditable="true"}},n}return vl(t,e),t.prototype.render=function(){return a().createElement("span",{suppressContentEditableWarning:!0,ref:this.makeEditable,"data-type":"wysiwyg",className:"TextInput",role:"textbox","aria-label":this.props.label,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus},this.props.value)},t}(i.Component),xl=(n(2680),function(e){var t=e.children,n=e.label,r=e.position,o=void 0===r?"below":r,i=e.long,s=void 0!==i&&i;return a().createElement("div",{className:"Tooltip"},a().createElement("span",{className:"above"===o?"Tooltip__label Tooltip__label--above":"Tooltip__label Tooltip__label--below",style:{width:s?"50ch":"10ch"}},n),t)});const wl="chooseFileSystemEntries"in self?"chooseFileSystemEntries":"showOpenFilePicker"in self&&"showOpenFilePicker",kl=wl?"chooseFileSystemEntries"===wl?n.e(736).then(n.bind(n,9012)):n.e(736).then(n.bind(n,499)):n.e(736).then(n.bind(n,5034));async function _l(...e){return(await kl).default(...e)}wl?"chooseFileSystemEntries"===wl?n.e(736).then(n.bind(n,6980)):n.e(736).then(n.bind(n,868)):n.e(736).then(n.bind(n,3110));const Ml=wl?"chooseFileSystemEntries"===wl?n.e(736).then(n.bind(n,1170)):n.e(736).then(n.bind(n,7814)):n.e(736).then(n.bind(n,4001));async function Sl(...e){return(await Ml).default(...e)}var El,zl=function(e,t,n,r,o,i){e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill(),e.stroke()},Cl=function(e,t){if(null!=t&&t.collaborators){var n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}var r=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),o=lt.elementBackground.slice(1),i=lt.elementStroke.slice(1);return{background:o[r%o.length],stroke:i[r%i.length]}};!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(El||(El={}));var Ll=function(){var e=document.createElement("canvas").getContext("2d");return!!e&&(e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0])}(),Ol=function(e,t,n,r,o,i,a,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.translate(i,a),e.rotate(s),l&&e.fillRect(t-i,n-a,r,o),e.strokeRect(t-i,n-a,r,o),e.rotate(-s),e.translate(-i,-a)},Tl=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},Al=function(e,t,n,r,o,i){var a=e.strokeStyle;e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(var s=n;s7&&void 0!==arguments[7]?arguments[7]:{},c=l.renderScrollbars,d=void 0===c||c,u=l.renderSelection,p=void 0===u||u,h=l.renderOptimizations,f=void 0!==h&&h,m=l.renderGrid,g=void 0===m||m;if(!i)return{atLeastOneVisibleElement:!1};var y=i.getContext("2d");y.scale(r,r);var v=i.width/r,b=i.height/r;if(a.exportWithDarkMode&&(y.filter=s.Gi),"string"==typeof a.viewBackgroundColor){("transparent"===a.viewBackgroundColor||5===a.viewBackgroundColor.length||9===a.viewBackgroundColor.length||/(hsla|rgba)\(/.test(a.viewBackgroundColor))&&y.clearRect(0,0,v,b);var x=y.fillStyle;y.fillStyle=a.viewBackgroundColor,y.fillRect(0,0,v,b),y.fillStyle=x}else y.clearRect(0,0,v,b);var w=a.zoom.translation.x,k=a.zoom.translation.y;y.translate(w,k),y.scale(a.zoom.value,a.zoom.value),g&&t.gridSize&&Al(y,t.gridSize,-Math.ceil(w/a.zoom.value/t.gridSize)*t.gridSize+a.scrollX%t.gridSize,-Math.ceil(k/a.zoom.value/t.gridSize)*t.gridSize+a.scrollY%t.gridSize,v/a.zoom.value,b/a.zoom.value);var _,M=e.filter((function(e){return $l(e,v,b,{zoom:a.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:a.scrollX,scrollY:a.scrollY})}));if(M.forEach((function(e){Qn(e,o,y,f,a)})),t.editingLinearElement){var S=ti.getElement(t.editingLinearElement.elementId);S&&Dl(y,t,a,S)}if(n&&Qn(n,o,y,f,a),oi(t)&&t.suggestedBindings.filter((function(e){return null!=e})).forEach((function(e){Rl(y,a,e)})),p&&!t.multiElement&&!t.editingLinearElement){for(var E=e.reduce((function(e,n){var r=[];if(t.selectedElementIds[n.id]&&!br(t,n)&&r.push(it.Sn),a.remoteSelectedElementIds[n.id]&&r.push.apply(r,a.remoteSelectedElementIds[n.id].map((function(e){return Cl(e,t).background}))),r.length){var o=Ye(n),i=o[0],s=o[1],l=o[2],c=o[3];e.push({angle:n.angle,elementX1:i,elementY1:s,elementX2:l,elementY2:c,selectionColors:r})}return e}),[]),z=function(t){var n=Mr(e,t),r=nt(n),o=r[0],i=r[1],a=r[2],s=r[3];E.push({angle:0,elementX1:o,elementX2:a,elementY1:i,elementY2:s,selectionColors:[it.Sn]})},C=0,L=wr(t);C1&&!t.isRotating){var A=4/a.zoom.value;y.fillStyle=it.ix;var D=nt(O),P=D[0],I=D[1],N=D[2],R=D[3],B=y.getLineDash();y.setLineDash([2/a.zoom.value]);var j=y.lineWidth;y.lineWidth=1/a.zoom.value,Ol(y,P-A,I-A,N-P+2*A,R-I+2*A,(P+N)/2,(I+R)/2,0),y.lineWidth=j,y.setLineDash(B),T=Fr([P,I,N,R],0,a.zoom,"mouse",Br),Il(y,a,T,0)}y.translate(-a.scrollX,-a.scrollY)}for(var $ in y.scale(1/a.zoom.value,1/a.zoom.value),y.translate(-w,-k),a.remotePointerViewportCoords){var K=a.remotePointerViewportCoords[$],q=K.x,F=K.y;q-=t.offsetLeft,F-=t.offsetTop;var H=9,W=14,V=q<0||q>v-H||F<0||F>b-W;q=Math.max(q,0),q=Math.min(q,v-H),F=Math.max(F,0),F=Math.min(F,b-W);var U=Cl($,t),Z=U.background,G=U.stroke,X=y.strokeStyle,Y=(x=y.fillStyle,y.globalAlpha);y.strokeStyle=G,y.fillStyle=Z;var J=a.remotePointerUserStates[$];(V||J===El.AWAY)&&(y.globalAlpha=.48),a.remotePointerButton&&"down"===a.remotePointerButton[$]&&(y.beginPath(),y.arc(q,F,15,0,2*Math.PI,!1),y.lineWidth=3,y.strokeStyle="#ffffff88",y.stroke(),y.closePath(),y.beginPath(),y.arc(q,F,15,0,2*Math.PI,!1),y.lineWidth=1,y.strokeStyle=G,y.stroke(),y.closePath()),y.beginPath(),y.moveTo(q,F),y.lineTo(q+1,F+14),y.lineTo(q+4,F+9),y.lineTo(q+9,F+10),y.lineTo(q,F),y.fill(),y.stroke();var Q=a.remotePointerUsernames[$],ee="";J===El.AWAY?ee=Ll?"⚫️":" (".concat(El.AWAY,")"):J===El.IDLE?ee=Ll?"💤":" (".concat(El.IDLE,")"):J===El.ACTIVE&&(ee=Ll?"🟢":"");var te="".concat(Q?"".concat(Q," "):"").concat(ee);if(!V&&te){var ne=q+H,re=F+W,oe=4,ie=4,ae=y.measureText(te),se=ae.actualBoundingBoxDescent+ae.actualBoundingBoxAscent;y.fillStyle=G,y.fillRect(ne-1,re-1,ae.width+2*oe+2,se+2*ie+2),y.fillStyle=Z,y.fillRect(ne,re,ae.width+2*oe,se+2*ie),y.fillStyle=it.ix,y.fillText(te,ne+oe,re+ie+ae.actualBoundingBoxAscent)}y.strokeStyle=X,y.fillStyle=x,y.globalAlpha=Y,y.closePath()}return d&&(_=oa(e,v,b,a),x=y.fillStyle,X=y.strokeStyle,y.fillStyle=ra,y.strokeStyle="rgba(255,255,255,0.8)",[_.horizontal,_.vertical].forEach((function(e){e&&zl(y,e.x,e.y,e.width,e.height,3)})),y.fillStyle=x,y.strokeStyle=X),y.scale(1/r,1/r),{atLeastOneVisibleElement:M.length>0,scrollBars:_}},Il=function(e,t,n,r){Object.keys(n).forEach((function(o){var i=n[o];if(void 0!==i){var a=e.lineWidth;e.lineWidth=1/t.zoom.value,"rotation"===o?Tl(e,i[0]+i[2]/2,i[1]+i[3]/2,i[2]/2):Ol(e,i[0],i[1],i[2],i[3],i[0]+i[2]/2,i[1]+i[3]/2,r,!0),e.lineWidth=a}}))},Nl=function(e,t,n){var r=n.angle,o=n.elementX1,i=n.elementY1,a=n.elementX2,s=n.elementY2,l=n.selectionColors,c=a-o,d=s-i,u=e.getLineDash(),p=e.lineWidth,h=e.lineDashOffset,f=e.strokeStyle,m=4/t.zoom.value,g=8/t.zoom.value,y=4/t.zoom.value;e.lineWidth=1/t.zoom.value,e.translate(t.scrollX,t.scrollY);for(var v=l.length,b=0;b=i&&d.y>=a},Kl=function(){for(var e=0,t=0,n=arguments.length;t3&&void 0!==arguments[3]?arguments[3]:function(e,t){var n=document.createElement("canvas");return n.width=e*l,n.height=t*l,{canvas:n,scale:l}},u=Wl(e,c),p=Ul(u,i,c),h=p[0],f=p[1],m=d(p[2],p[3]),g=m.canvas,y=m.scale;return Pl(u,t,null,void 0===y?l:y,Te.canvas(g),g,{viewBackgroundColor:r?a:null,exportWithDarkMode:t.exportWithDarkMode,scrollX:-h+i,scrollY:-f+i,zoom:In().zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{}},{renderScrollbars:!1,renderSelection:!1,renderOptimizations:!1,renderGrid:!1}),g},Hl=function(e,t){var n=t.exportBackground,r=t.exportPadding,o=void 0===r?10:r,i=t.viewBackgroundColor,a=t.exportWithDarkMode,l=t.scale,c=void 0===l?1:l,d=t.shouldAddWatermark,u=t.metadata,p=void 0===u?"":u,h=Wl(e,d),f=Ul(h,o,d),m=f[0],g=f[1],y=f[2],v=f[3],b=document.createElementNS(dn,"svg");if(b.setAttribute("version","1.1"),b.setAttribute("xmlns",dn),b.setAttribute("viewBox","0 0 ".concat(y," ").concat(v)),b.setAttribute("width","".concat(y*c)),b.setAttribute("height","".concat(v*c)),a&&b.setAttribute("filter",s.Gi),b.innerHTML="\n ".concat(ql,"\n ").concat(p,'\n \n \n \n '),n&&i){var x=b.ownerDocument.createElementNS(dn,"rect");x.setAttribute("x","0"),x.setAttribute("y","0"),x.setAttribute("width","".concat(y)),x.setAttribute("height","".concat(v)),x.setAttribute("fill",i),b.appendChild(x)}return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.offsetX,i=void 0===o?0:o,a=r.offsetY,s=void 0===a?0:a;n&&e.forEach((function(e){e.isDeleted||er(e,t,n,e.x+i,e.y+s)}))}(h,Te.svg(b),b,{offsetX:-m+o,offsetY:-g+o}),b},Wl=function(e,t){var n=Kl(e);if(t){var r=nt(e),o=r[2],i=r[3];n=Kl(n,[Vl(o,i)])}return n},Vl=function(e,t){return Ar({text:w("labels.madeWithExcalidraw"),fontSize:16,fontFamily:s.rk,textAlign:"right",verticalAlign:s.hs,x:e,y:t+16,strokeColor:it.MA[5],backgroundColor:"transparent",fillStyle:"hachure",strokeWidth:1,strokeStyle:"solid",roughness:1,opacity:100,strokeSharpness:"sharp"})},Ul=function(e,t,n){var r=nt(e),o=r[0],i=r[1],a=r[2],s=r[3];return[o,i,xn(o,a)+2*t,xn(i,s)+t+(n?0:t)]},Zl=function(){for(var e=0,t=0,n=arguments.length;t2)return{type:ec,reason:"More than 2 columns"};if(1===t){if(!rc(e,0))return{type:ec,reason:"Value is not numeric"};var n=null===nc(e[0][0]),r=(n?e.slice(1):e).map((function(e){return nc(e[0])}));return r.length<2?{type:ec,reason:"Less than two rows"}:{type:tc,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=rc(e,0)?0:1;if(!rc(e,o))return{type:ec,reason:"Value is not numeric"};var i=(o+1)%2,a=null===nc(e[0][o]),s=a?e.slice(1):e;return s.length<2?{type:ec,reason:"Less than 2 rows"}:{type:tc,spreadsheet:{title:a?e[0][o]:null,labels:s.map((function(e){return e[i]})),values:s.map((function(e){return nc(e[o])}))}}},ic=lt.elementBackground.slice(2,lt.elementBackground.length),ac={fillStyle:"hachure",fontFamily:s.rk,fontSize:s.n5,opacity:100,roughness:1,strokeColor:lt.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},sc=function(e){return{chartWidth:44*e.values.length+Jl,chartHeight:280}},lc=function(e,t,n,r,o,i){var a=sc(e),l=a.chartWidth,c=a.chartHeight,d=e.title?Ar(Xl(Xl({backgroundColor:o,groupIds:[r]},ac),{},{text:e.title,x:t+l/2,y:n-Ql-24-s.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,u=i?Or(Xl(Xl({backgroundColor:o,groupIds:[r]},ac),{},{type:"rectangle",x:t,y:n-c,width:l,height:c,strokeColor:lt.elementStroke[0],fillStyle:"solid",opacity:6})):null;return Zl(u?[u]:[],d?[d]:[],function(e,t,n,r,o){var i;return(null===(i=e.labels)||void 0===i?void 0:i.map((function(e,i){return Ar(Xl(Xl({groupIds:[r],backgroundColor:o},ac),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*i+24,y:n+6,width:Yl,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[]}(e,t,n,r,o),function(e,t,n,r,o){var i=Ar(Xl(Xl({groupIds:[r],backgroundColor:o},ac),{},{x:t-Jl,y:n-Jl,text:"0",textAlign:"right"}));return[i,Ar(Xl(Xl({groupIds:[r],backgroundColor:o},ac),{},{x:t-Jl,y:n-Ql-i.height/2,text:Math.max.apply(Math,e.values).toLocaleString(),textAlign:"right"}))]}(e,t,n,r,o),function(e,t,n,r,o){var i=sc(e),a=i.chartWidth,s=i.chartHeight;return[Pr(Xl(Xl({backgroundColor:o,groupIds:[r]},ac),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:a,points:[[0,0],[a,0]]})),Pr(Xl(Xl({backgroundColor:o,groupIds:[r]},ac),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:s,points:[[0,0],[0,-s]]})),Pr(Xl(Xl({backgroundColor:o,groupIds:[r]},ac),{},{type:"line",x:t,y:n-Ql-Jl,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:a,opacity:50,points:[[0,0],[a,0]]}))]}(e,t,n,r,o))},cc=function(e,t,n,r){return"line"===e?function(e,t,n){for(var r=Math.max.apply(Math,e.values),o=ar(),i=ic[Math.floor(Math.random()*ic.length)],a=0,l=[],c=0,d=e.values;c0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return(t=e.call(this)||this).name=r,t.message=n,t}return dc(t,e),t}(Error);function pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hc(e){for(var t=1;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=2&&!function(e){if(e.length>=2)for(var t=function(t){if(e.reduce((function(e,n){return e&&_r(n,t)}),!0))return{value:!0}},n=0,r=e[0].groupIds;n0},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{type:"button",hidden:0===wr(n).length,icon:a().createElement(es,{appearance:n.appearance}),onClick:function(){return r(null)},title:"".concat(w("labels.ungroup")," — ").concat(Mn("CtrlOrCmd+Shift+G")),"aria-label":w("labels.ungroup"),visible:aa(Qi(t),n)})}}),wd=(n(566),function(e){var t=e.children,n=e.color,r=e.border,o=e.onClick;return a().createElement("div",{className:"Avatar",style:{background:n,border:"1px solid ".concat(r)},onClick:o},t)});function kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _d(e){for(var t=1;t1},Dd=function(e,t,n){var r=function(e,t){var n=Ld(e),r=Td(e);return n.flatMap((function(e){var n=Od(e,r,t);return e.map((function(e){return dr(e,{x:e.x+n.x,y:e.y+n.y})}))}))}(sa(Qi(e),t),n),o=Yi(r);return e.map((function(e){return o[e.id]||e}))},Pd=(vs({name:"alignTop",perform:function(e,t){return{appState:t,elements:Dd(e,t,{position:"start",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[Bt]&&e.shiftKey&&e.key===It},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{hidden:!Ad(t,n),type:"button",icon:a().createElement(qa,{appearance:n.appearance}),onClick:function(){return r(null)},title:"".concat(w("labels.alignTop")," — ").concat(Mn("CtrlOrCmd+Shift+Up")),"aria-label":w("labels.alignTop"),visible:aa(Qi(t),n)})}}),vs({name:"alignBottom",perform:function(e,t){return{appState:t,elements:Dd(e,t,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[Bt]&&e.shiftKey&&e.key===At},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{hidden:!Ad(t,n),type:"button",icon:a().createElement(Fa,{appearance:n.appearance}),onClick:function(){return r(null)},title:"".concat(w("labels.alignBottom")," — ").concat(Mn("CtrlOrCmd+Shift+Down")),"aria-label":w("labels.alignBottom"),visible:aa(Qi(t),n)})}}),vs({name:"alignLeft",perform:function(e,t){return{appState:t,elements:Dd(e,t,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[Bt]&&e.shiftKey&&e.key===Dt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{hidden:!Ad(t,n),type:"button",icon:a().createElement(Ha,{appearance:n.appearance}),onClick:function(){return r(null)},title:"".concat(w("labels.alignLeft")," — ").concat(Mn("CtrlOrCmd+Shift+Left")),"aria-label":w("labels.alignLeft"),visible:aa(Qi(t),n)})}}),vs({name:"alignRight",perform:function(e,t){return{appState:t,elements:Dd(e,t,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[Bt]&&e.shiftKey&&e.key===Pt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{hidden:!Ad(t,n),type:"button",icon:a().createElement(Wa,{appearance:n.appearance}),onClick:function(){return r(null)},title:"".concat(w("labels.alignRight")," — ").concat(Mn("CtrlOrCmd+Shift+Right")),"aria-label":w("labels.alignRight"),visible:aa(Qi(t),n)})}}),vs({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:Dd(e,t,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{hidden:!Ad(t,n),type:"button",icon:a().createElement(Za,{appearance:n.appearance}),onClick:function(){return r(null)},title:w("labels.centerVertically"),"aria-label":w("labels.centerVertically"),visible:aa(Qi(t),n)})}}),vs({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:Dd(e,t,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return a().createElement(ba,{hidden:!Ad(t,n),type:"button",icon:a().createElement(Ga,{appearance:n.appearance}),onClick:function(){return r(null)},title:w("labels.centerHorizontally"),"aria-label":w("labels.centerHorizontally"),visible:aa(Qi(t),n)})}}),function(){for(var e=0,t=0,n=arguments.length;t1},Bd=function(e,t,n){var r=function(e,t){for(var n="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],r=n[0],o=n[1],i=n[2],a=n[3],s=Nd(e),l=Id(e).map((function(e){return[e,Nd(e)]})).sort((function(e,t){return e[1][o]-t[1][o]})),c=0,d=0,u=l;d0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1;r--){var o=e.elements[r],i=n.elements[r];if(!o||!i||o.id!==i.id||o.versionNonce!==i.versionNonce)return!0}for(t in e.appState){var a,s;if(("editingLinearElement"!==t||(null===(a=e.appState[t])||void 0===a?void 0:a.elementId)!==(null===(s=n.appState[t])||void 0===s?void 0:s.elementId))&&"selectedElementIds"!==t&&e.appState[t]!==n.appState[t])return!0}return!1},e.prototype.pushEntry=function(e,t){var n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}},e.prototype.clearRedoStack=function(){this.redoStack.splice(0,this.redoStack.length)},e.prototype.redoOnce=function(){if(0===this.redoStack.length)return null;var e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null},e.prototype.undoOnce=function(){if(1===this.stateHistory.length)return null;var e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null},e.prototype.setCurrentState=function(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))},e.prototype.resumeRecording=function(){this.recording=!0},e.prototype.record=function(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)},e}(),yu=[{icon:a().createElement("svg",{viewBox:"0 0 320 512",className:""},a().createElement("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})),value:"selection",key:[tn,Qt]},{icon:a().createElement("svg",{viewBox:"0 0 448 512"},a().createElement("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})),value:"rectangle",key:Jt},{icon:a().createElement("svg",{viewBox:"0 0 223.646 223.646"},a().createElement("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})),value:"diamond",key:Vt},{icon:a().createElement("svg",{viewBox:"0 0 512 512"},a().createElement("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})),value:"ellipse",key:Ut},{icon:a().createElement("svg",{viewBox:"0 0 448 512",className:"rtl-mirror"},a().createElement("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})),value:"arrow",key:Wt},{icon:a().createElement("svg",{viewBox:"0 0 6 6"},a().createElement("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})),value:"line",key:[Xt,Zt]},{icon:a().createElement("svg",{viewBox:"0 0 512 512"},a().createElement("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})),value:"draw",key:nn},{icon:a().createElement("svg",{viewBox:"0 0 448 512"},a().createElement("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})),value:"text",key:en}],vu=(n(4518),{cut:[Mn("CtrlOrCmd+X")],copy:[Mn("CtrlOrCmd+C")],paste:[Mn("CtrlOrCmd+V")],copyStyles:[Mn("CtrlOrCmd+Alt+C")],pasteStyles:[Mn("CtrlOrCmd+Alt+V")],selectAll:[Mn("CtrlOrCmd+A")],deleteSelectedElements:[Mn("Del")],duplicateSelection:[Mn("CtrlOrCmd+D"),Mn("Alt+".concat(w("helpDialog.drag")))],sendBackward:[Mn("CtrlOrCmd+[")],bringForward:[Mn("CtrlOrCmd+]")],sendToBack:[Mn(dt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Mn(dt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Mn("Shift+Alt+C")],copyAsSvg:[],group:[Mn("CtrlOrCmd+G")],ungroup:[Mn("CtrlOrCmd+Shift+G")],gridMode:[Mn("CtrlOrCmd+'")],zenMode:[Mn("Alt+Z")],stats:[],addToLibrary:[],viewMode:[Mn("Alt+R")]}),bu=function(e){var t,n=e.options,r=e.onCloseRequest,o=e.top,i=e.left,s=e.actionManager,l=e.appState,c=!(null===(t=document.querySelector(".excalidraw"))||void 0===t||!t.classList.contains("Appearance_dark"));return a().createElement("div",{className:De("excalidraw",{"Appearance_dark Appearance_dark-background-none":c})},a().createElement(Vs,{onCloseRequest:r,top:o,left:i,fitInViewport:!0},a().createElement("ul",{className:"context-menu",onContextMenu:function(e){return e.preventDefault()}},n.map((function(e,t){var n;if("separator"===e)return a().createElement("hr",{key:t,className:"context-menu-option-separator"});var o,i=e.name,c=e.contextItemLabel?w(e.contextItemLabel):"";return a().createElement("li",{key:t,"data-testid":i,onClick:r},a().createElement("button",{className:De("context-menu-option",{dangerous:"deleteSelectedElements"===i,checkmark:null===(n=e.checked)||void 0===n?void 0:n.call(e,l)}),onClick:function(){return s.executeAction(e)}},a().createElement("div",{className:"context-menu-option__label"},c),a().createElement("kbd",{className:"context-menu-option__shortcut"},i&&(o=vu[i])&&o.length>0?o[0]:"")))})))))},xu=function(){if(fu)return fu;var e=document.createElement("div");return document.body.appendChild(e),fu=e},wu=function(){(0,ct.unmountComponentAtNode)(xu())};const ku=function(e){var t=Array.of();e.options.forEach((function(e){e&&t.push(e)})),t.length&&(0,ct.render)(a().createElement(bu,{top:e.top,left:e.left,options:t,onCloseRequest:wu,actionManager:e.actionManager,appState:e.appState}),xu())};function _u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mu(e){for(var t=1;t1&&a().createElement("fieldset",null,a().createElement("legend",null,w("labels.align")),a().createElement("div",{className:"buttonList"},c?a().createElement(a().Fragment,null,r("alignRight"),r("alignHorizontallyCentered"),r("alignLeft")):a().createElement(a().Fragment,null,r("alignLeft"),r("alignHorizontallyCentered"),r("alignRight")),i.length>2&&r("distributeHorizontally"),a().createElement("div",{className:"iconRow"},r("alignTop"),r("alignVerticallyCentered"),r("alignBottom"),i.length>2&&r("distributeVertically")))),!l&&!s&&i.length>0&&a().createElement("fieldset",null,a().createElement("legend",null,w("labels.actions")),a().createElement("div",{className:"buttonList"},r("duplicateSelection"),r("deleteSelectedElements"),r("group"),r("ungroup"))))},Cu=function(e){var t=e.elementType,n=e.setAppState;return e.isLibraryOpen,a().createElement(a().Fragment,null,yu.map((function(e,r){var o=e.value,i=e.icon,s=e.key,l=w("toolBar.".concat(o)),c="string"==typeof s?s:s[0],d="".concat(pn(c)," ").concat(w("helpDialog.or")," ").concat(r+1);return a().createElement(ba,{className:"Shape",key:o,type:"radio",icon:i,checked:t===o,name:"editor-current-shape",title:"".concat(pn(l)," — ").concat(d),keyBindingLabel:"".concat(r+1),"aria-label":pn(l),"aria-keyshortcuts":d,"data-testid":o,onChange:function(){n({elementType:o,multiElement:null,selectedElementIds:{}}),kn(o),n({})}})})))},Lu=function(e){var t=e.renderAction,n=e.zoom;return a().createElement(Eu,{gap:1},a().createElement(Su,{gap:1,align:"center"},t("zoomIn"),t("zoomOut"),t("resetZoom"),a().createElement("div",{style:{marginInlineStart:4}},(100*n.value).toFixed(0),"%")))},Ou=function(e){var t=e.appState,n=e.setAppState,r=e.actionManager;return a().createElement("div",{style:{display:"flex"}},r.renderAction("changeViewBackgroundColor"),a().createElement("div",{style:{marginInlineStart:"0.25rem"}},a().createElement(nd,{value:t.appearance,onChange:function(e){n({appearance:e})}})))};function Tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t0&&!1!==e.autofocus&&(t[1]||t[0]).focus();var r=function(e){if(e.key===Ht){var t=o(n),r=document.activeElement,i=t.findIndex((function(e){return e===r}));0===i&&e.shiftKey?(t[t.length-1].focus(),e.preventDefault()):i!==t.length-1||e.shiftKey||(t[0].focus(),e.preventDefault())}};return n.addEventListener("keydown",r),function(){return n.removeEventListener("keydown",r)}}}),[n,e.autofocus]);var o=function(e){var t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]};return a().createElement(Pu,{className:De("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:e.onCloseRequest},a().createElement(Du,{ref:r},a().createElement("h2",{id:"dialog-title",className:"Dialog__title"},a().createElement("span",{className:"Dialog__titleContent"},e.title),a().createElement("button",{className:"Modal__close",onClick:e.onCloseRequest,"aria-label":w("buttons.close")},ul()?Ya:Xa)),a().createElement("div",{className:"Dialog__content"},e.children)))},Ru=function(e){var t=e.message,n=e.onClose,r=(0,i.useState)(!!t),o=r[0],s=r[1],l=a().useCallback((function(){s(!1),n&&n()}),[n]);return a().createElement(a().Fragment,null,o&&a().createElement(Nu,{small:!0,onCloseRequest:l,title:w("errorDialog.title")},a().createElement("div",null,t.split("\n").map((function(e){return a().createElement(a().Fragment,null,e,a().createElement("br",null))})))))};n(8623);var Bu=(document.createElement("canvas").getContext("2d"),function(e){var t=e.elements,n=(e.appState,e.exportPadding,e.actionManager,e.onExportToPng,e.onExportToSvg),r=(e.onExportToClipboard,e.onExportToBackend,(0,i.useState)(!1)),o=(r[0],r[1]),s=(0,i.useRef)(null);return a().useCallback((function(){var e;o(!1),null===(e=s.current)||void 0===e||e.focus()}),[]),a().createElement(a().Fragment,null,a().createElement(ba,{onClick:function(){n(t,1)},icon:Ma,type:"button","aria-label":w("buttons.save"),showAriaLabel:ul(),title:w("buttons.save"),ref:s}))}),ju=(n(4193),function(e){var t=e.children,n=e.side,r=e.className;return a().createElement("div",{className:De("FixedSideContainer","FixedSideContainer_side_".concat(n),r)},t)}),$u=(n(9705),function(e){var t=function(e){var t=e.appState,n=e.elements,r=t.elementType,o=t.isResizing,i=t.isRotating,a=t.lastPointerDownWith,s=null!==t.multiElement;if("arrow"===r||"line"===r)return w(s?"hints.linearElementMulti":"hints.linearElement");if("draw"===r)return w("hints.freeDraw");if("text"===r)return w("hints.text");var l=sa(n,t);if(o&&"mouse"===a&&1===l.length){var c=l[0];return Ie(c)&&2===c.points.length?w("hints.lockAngle"):w("hints.resize")}return i&&"mouse"===a?w("hints.rotate"):1===l.length&&Ie(l[0])?t.editingLinearElement?t.editingLinearElement.activePointIndex?w("hints.lineEditor_pointSelected"):w("hints.lineEditor_nothingSelected"):w("hints.lineEditor_info"):null}({appState:e.appState,elements:e.elements});return t?(t=Mn(t),a().createElement("div",{className:"HintViewer"},a().createElement("span",null,t))):null}),Ku=(n(8465),n(8680),a().createElement("svg",{viewBox:"0 0 1792 1792"},a().createElement("path",{fill:"currentColor",d:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"}))),qu=function(e){var t=e.elements,n=e.pendingElements,r=e.onRemoveFromLibrary,o=e.onClick,l=(0,i.useRef)(null);(0,i.useEffect)((function(){var e=t||n;if(e){for(var r=Hl(e,{exportBackground:!1,viewBackgroundColor:it.ix,shouldAddWatermark:!1}),o=0,i=l.current.children;o0&&a().createElement("fieldset",null,a().createElement("legend",null,w("labels.collaborators")),a().createElement(Uu,{mobile:!0},Array.from(t.collaborators).filter((function(e){e[0];var t=e[1];return 0!==Object.keys(t).length})).map((function(e){var t=e[0];return e[1],a().createElement(a().Fragment,{key:t},r.renderAction("goToCollaborator",t))}))))))):"shape"===t.openMenu&&!c&&Ui(t,n)?a().createElement(Vu,{className:"App-mobile-menu",heading:"selectedShapeActions"},a().createElement(zu,{appState:t,elements:n,renderAction:r.renderAction,elementType:t.elementType})):null,a().createElement("footer",{className:"App-toolbar"},c?a().createElement("div",{className:"App-toolbar-content"},r.renderAction("toggleCanvasMenu")):a().createElement("div",{className:"App-toolbar-content"},r.renderAction("toggleCanvasMenu"),r.renderAction("toggleEditMenu"),r.renderAction("undo"),r.renderAction("redo"),r.renderAction(t.multiElement?"finalize":"duplicateSelection"),r.renderAction("deleteSelectedElements")),t.scrolledOutside&&!t.openMenu&&a().createElement("button",{className:"scroll-back-to-content",onClick:function(){i(function(e){for(var t=1;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?1:0),u=c?4:6,p=Math.max(1,Math.ceil(d/u)),h=[],f=!1;h.push(a().createElement("div",{className:"layer-ui__library-header"},a().createElement(ba,{key:"import",type:"button",title:w("buttons.load"),"aria-label":w("buttons.load"),icon:Ea,onClick:function(){Qc().then((function(){s({isLibraryOpen:!1})})).catch(Tn).catch((function(e){s({errorMessage:e.message})}))}}),a().createElement(ba,{key:"export",type:"button",title:w("buttons.export"),"aria-label":w("buttons.export"),icon:La,onClick:function(){Jc().catch(Tn).catch((function(e){s({errorMessage:e.message})}))}}),a().createElement(ba,{key:"reset",type:"button",title:w("buttons.resetLibrary"),"aria-label":w("buttons.resetLibrary"),icon:za,onClick:function(){window.confirm(w("alerts.resetLibrary"))&&(Hc.resetLibrary(),l([]))}}),a().createElement("a",{href:"https://libraries.excalidraw.com",target:"_excalidraw_libraries"},w("labels.libraries"))));for(var m=0;m0&&!f&&g+v>=t.length;f=f||b,y.push(a().createElement(Eu,{key:v},a().createElement(qu,{elements:t[g+v],pendingElements:b?i:void 0,onRemoveFromLibrary:n.bind(null,g+v),onClick:b?r.bind(null,i):o.bind(null,t[g+v])})))}h.push(a().createElement(Su,{align:"center",gap:1,key:m},y))}return a().createElement(Eu,{align:"start",gap:1,className:"layer-ui__library-items"},h)},up=function(e){var t=e.onClickOutside,n=e.onInsertShape,r=e.pendingElements,o=e.onAddToLibrary,s=e.setAppState,c=(0,i.useRef)(null);!function(e,t){(0,i.useEffect)((function(){var n=function(n){e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),function(){document.removeEventListener("pointerdown",n)}}),[e,t])}(c,(function(e){e.target.closest(".ToolIcon_type_button__library")||t(e)}));var d=(0,i.useState)([]),u=d[0],p=d[1],h=(0,i.useState)("preloading"),f=h[0],m=h[1],g=(0,i.useRef)(null);(0,i.useEffect)((function(){return Promise.race([new Promise((function(e){g.current=setTimeout((function(){e("loading")}),100)})),Hc.loadLibrary().then((function(e){p(e),m("ready")}))]).then((function(e){"loading"===e&&m("loading")})),function(){clearTimeout(g.current)}}),[]);var y=(0,i.useCallback)(function(){var e=(0,l.Z)((function(e){var t,n;return ap(this,(function(r){switch(r.label){case 0:return[4,Hc.loadLibrary()];case 1:return t=r.sent(),n=t.filter((function(t,n){return n!==e})),Hc.saveLibrary(n),p(n),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[]),v=(0,i.useCallback)(function(){var e=(0,l.Z)((function(e){var t,n;return ap(this,(function(r){switch(r.label){case 0:return[4,Hc.loadLibrary()];case 1:return t=r.sent(),n=sp(t,[e]),o(),Hc.saveLibrary(n),p(n),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[o]);return"preloading"===f?null:a().createElement(Du,{padding:1,ref:c,className:"layer-ui__library"},"loading"===f?a().createElement("div",{className:"layer-ui__library-message"},w("labels.libraryLoadingMessage")):a().createElement(dp,{library:u,onRemoveFromLibrary:y,onAddToLibrary:v,onInsertShape:n,pendingElements:r,setAppState:s,setLibraryItems:p}))},pp=function(e){var t,n=e.actionManager,r=e.appState,o=e.setAppState,c=e.canvas,d=e.elements,u=e.onCollabButtonClick,p=e.onLockToggle,h=e.onInsertElements,f=e.zenModeEnabled,m=e.showExitZenModeBtn,g=e.toggleZenMode,y=e.isCollaborating,v=e.onExportToBackend,b=e.renderCustomFooter,x=e.viewModeEnabled,_=e.onExport,M=ul(),S=function(){var e=function(e){return function(){var t=(0,l.Z)((function(t,n){var i;return ap(this,(function(a){switch(a.label){case 0:return c?[4,td(e,t,r,c,{exportBackground:r.exportBackground,name:r.name,viewBackgroundColor:r.viewBackgroundColor,scale:n,shouldAddWatermark:r.shouldAddWatermark}).catch(Tn).catch((function(e){console.error(e),o({errorMessage:e.message})}))]:[3,2];case 1:i=a.sent(),_&&i&&_(i),a.label=2;case 2:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}()};return a().createElement(Bu,{elements:d,appState:r,actionManager:n,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard"),onExportToBackend:v?function(e){v&&v(e,r,c)}:void 0})},E=(0,i.useCallback)((function(e){o({isLibraryOpen:!1})}),[o]),z=(0,i.useCallback)((function(){o({selectedElementIds:{},selectedGroupIds:{}})}),[o]),L=r.isLibraryOpen?a().createElement(up,{pendingElements:sa(d,r),onClickOutside:E,onInsertShape:h,onAddToLibrary:z,setAppState:o}):null,O=a().createElement(a().Fragment,null,r.isLoading&&a().createElement(k,null),r.errorMessage&&a().createElement(Ru,{message:r.errorMessage,onClose:function(){return o({errorMessage:null})}}),r.showHelpDialog&&a().createElement(ip,{onClose:function(){return o({showHelpDialog:!1})}}),r.pasteDialog.shown&&a().createElement(Yu,{setAppState:o,appState:r,onInsertChart:h,onClose:function(){return o({pasteDialog:{shown:!1,data:null}})}}));return M?a().createElement(a().Fragment,null,O,a().createElement(Gu,{appState:r,elements:d,actionManager:n,libraryMenu:L,exportButton:S(),setAppState:o,onCollabButtonClick:u,onLockToggle:p,canvas:c,isCollaborating:y,renderCustomFooter:b,viewModeEnabled:x})):a().createElement("div",{className:De("layer-ui__wrapper",{"disable-pointerEvents":r.draggingElement||r.resizingElement||r.editingElement&&!Pe(r.editingElement)})},O,(t=Ui(r,d),a().createElement(ju,{side:"top"},a().createElement("div",{className:"App-menu App-menu_top"},a().createElement(Eu,{gap:4,className:De({"disable-pointerEvents":f})},x?a().createElement(Vu,{heading:"canvasActions",className:De("zen-mode-transition",{"transition-left":f})},a().createElement(Du,{padding:2,style:{zIndex:1}},a().createElement(Eu,{gap:4},a().createElement(Su,{gap:1,justifyContent:"space-between"},n.renderAction("saveScene"),n.renderAction("saveAsScene"),S())))):a().createElement(Vu,{heading:"canvasActions",className:De("zen-mode-transition",{"transition-left":f})},a().createElement(Du,{padding:2,style:{zIndex:1}},a().createElement(Eu,{gap:4},a().createElement(Su,{gap:1,justifyContent:"space-between"},S(),n.renderAction("clearCanvas")),a().createElement(Ou,{actionManager:n,appState:r,setAppState:o})))),t&&a().createElement(Vu,{heading:"selectedShapeActions",className:De("zen-mode-transition",{"transition-left":f})},a().createElement(Du,{className:s.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(r.height-200,"px")}},a().createElement(zu,{appState:r,elements:d,renderAction:n.renderAction,elementType:r.elementType})))),!x&&a().createElement(Vu,{heading:"shapes"},(function(e){return a().createElement(Eu,{gap:4,align:"start"},a().createElement(Su,{gap:1},a().createElement(Du,{padding:1,className:De({"zen-mode":f})},a().createElement($u,{appState:r,elements:d}),e,a().createElement(Su,{gap:1},a().createElement(Cu,{elementType:r.elementType,setAppState:o,isLibraryOpen:r.isLibraryOpen}))),a().createElement(Hu,{zenModeEnabled:f,checked:r.elementLocked,onChange:p,title:w("toolBar.lock")})))})),a().createElement(Uu,{className:De("zen-mode-transition",{"transition-right":f})},r.collaborators.size>0&&Array.from(r.collaborators).filter((function(e){e[0];var t=e[1];return 0!==Object.keys(t).length})).map((function(e){var t=e[0],r=e[1];return a().createElement(xl,{label:r.username||"Unknown user",key:t},n.renderAction("goToCollaborator",t))})))))),a().createElement("div",{className:De("App-menu App-menu_bottom zen-mode-transition",{"App-menu_bottom--transition-left":f})},a().createElement(Eu,{gap:2},a().createElement(Vu,{heading:"canvasActions"},a().createElement(Du,{padding:1},a().createElement(Lu,{renderAction:n.renderAction,zoom:r.zoom}))))),a().createElement("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer"},a().createElement("div",{className:De("zen-mode-transition",{"transition-right disable-pointerEvents":f})},null==b?void 0:b(!1),n.renderAction("toggleShortcuts")),a().createElement("button",{className:De("disable-zen-mode",{"disable-zen-mode--visible":m}),onClick:g},w("buttons.exitZenMode"))),r.scrolledOutside&&a().createElement("button",{className:"scroll-back-to-content",onClick:function(){o(function(e){for(var t=1;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&a().createElement(a().Fragment,null,a().createElement("tr",null,a().createElement("th",{colSpan:2},w("stats.selected"))),a().createElement("tr",null,a().createElement("td",null,w("stats.elements")),a().createElement("td",null,d.length))),d.length>0&&a().createElement(a().Fragment,null,a().createElement("tr",null,a().createElement("td",null,"x"),a().createElement("td",null,Math.round(1===d.length?d[0].x:u[0]))),a().createElement("tr",null,a().createElement("td",null,"y"),a().createElement("td",null,Math.round(1===d.length?d[0].y:u[1]))),a().createElement("tr",null,a().createElement("td",null,w("stats.width")),a().createElement("td",null,Math.round(1===d.length?d[0].width:u[2]-u[0]))),a().createElement("tr",null,a().createElement("td",null,w("stats.height")),a().createElement("td",null,Math.round(1===d.length?d[0].height:u[3]-u[1])))),1===d.length&&a().createElement("tr",null,a().createElement("td",null,w("stats.angle")),a().createElement("td",null,"".concat(Math.round(180*d[0].angle/Math.PI),"°"))),a().createElement("tr",null,a().createElement("th",{colSpan:2},w("stats.version"))),a().createElement("tr",null,a().createElement("td",{colSpan:2,style:{textAlign:"center",cursor:"pointer"},onClick:(0,l.Z)((function(){return xp(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,$c(Pn())];case 1:return t.sent(),e.setAppState({toastMessage:w("toast.copyToClipboard")}),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))})),title:w("stats.versionCopy")},h,a().createElement("br",null),p))))))},_p=(n(5849),function(e){var t=e.message,n=e.clearToast,r=(0,i.useRef)(0),o=(0,i.useCallback)((function(){return r.current=window.setTimeout((function(){return n()}),s.Lg)}),[n]);return(0,i.useEffect)((function(){return o(),function(){return clearTimeout(r.current)}}),[o,t]),a().createElement("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==r?void 0:r.current)},onMouseLeave:o},a().createElement("p",{className:"Toast__message"},t))});function Mp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0;this.state.scrolledOutside!==x&&this.setState({scrolledOutside:x}),Ap.record(this.state,this.scene.getElementsIncludingDeleted()),this.state.isLoading||null===(v=(b=this.props).onChange)||void 0===v||v.call(b,this.scene.getElementsIncludingDeleted(),this.state)},t.resetTapTwice=function(){Dp=!1},t.prototype.addTextFromPaste=function(e){var t,n=Sn({clientX:Ip,clientY:Np},this.state),r=n.x,o=n.y,i=Ar({x:r,y:o,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:s.hs});this.scene.replaceAllElements(Lp(this.scene.getElementsIncludingDeleted(),[i])),this.setState({selectedElementIds:(t={},t[i.id]=!0,t)}),Ap.resumeRecording()},t.prototype.selectShapeTool=function(e){var t;Rp||kn(e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&document.activeElement.blur(),Ne(e)||this.setState({suggestedBindings:[]}),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})},t.prototype.handleTextWysiwyg=function(e,t){var n=this,r=t.isExistingElement,o=void 0!==r&&r,i=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n.scene.replaceAllElements(Lp(n.scene.getElementsIncludingDeleted().map((function(n){return n.id===e.id&&Pe(n)?Dr(n,{text:t,isDeleted:r}):n}))))};!function(e){var t=e.id,n=e.appState,r=e.onChange,o=e.onSubmit,i=e.getViewportCoords,a=e.element,l=e.canvas,c=function(){var e,r=null===(e=rr.getScene(a))||void 0===e?void 0:e.getElement(t);if(r&&Pe(r)){var o=i(r.x,r.y),s=o[0],l=o[1],c=r.textAlign,u=r.angle;d.value=r.text;var p=r.text.replace(/\r\n?/g,"\n").split("\n"),h=r.height/p.length;Object.assign(d.style,{font:mn(r),lineHeight:"".concat(h,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px"),left:"".concat(s,"px"),top:"".concat(l,"px"),transform:Wi(r.width,r.height,u,n),textAlign:c,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--appearance-filter)"})}},d=document.createElement("textarea");d.dir="auto",d.tabIndex=0,d.dataset.type="wysiwyg",d.wrap="off",Object.assign(d.style,{position:"fixed",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",whiteSpace:"pre",zIndex:"var(--zIndex-wysiwyg)"}),c(),r&&(d.oninput=function(){r(Hi(d.value))}),d.onkeydown=function(e){if(e.key===Kt)e.preventDefault(),p();else if(e.key===$t&&e[Bt]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;p()}else e.key!==$t||e.altKey||e.stopPropagation()};var u=function(e){e.preventDefault(),e.stopPropagation()},p=function(){o(Hi(d.value)),h()},h=function(){y||(y=!0,d.onblur=null,d.oninput=null,d.onkeydown=null,v&&v.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("wheel",u,!0),window.removeEventListener("pointerdown",m),window.removeEventListener("pointerup",f),window.removeEventListener("blur",p),g(),d.remove())},f=function(){window.removeEventListener("pointerup",f),setTimeout((function(){d.onblur=p,d.focus()}))},m=function(e){e.target instanceof HTMLElement&&e.target.closest(".".concat(s.$C.SHAPE_ACTIONS_MENU))&&!hn(e.target)&&(d.onblur=null,window.addEventListener("pointerup",f),window.addEventListener("blur",p))},g=rr.getScene(a).addCallback((function(){c(),d.focus()})),y=!1;d.onblur=p;var v=null;l&&"ResizeObserver"in window?(v=new window.ResizeObserver((function(){c()}))).observe(l):window.addEventListener("resize",c),window.addEventListener("pointerdown",m),window.addEventListener("wheel",u,{passive:!1,capture:!0}),document.querySelector(".excalidraw-textEditorContainer").appendChild(d),d.focus(),d.select()}({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:function(e,t){var r=En({sceneX:e,sceneY:t},n.state);return[r.x,r.y]},onChange:An((function(t){i(t),ea(e)&&yi(e)})),onSubmit:An((function(t){var r=!t.trim();i(t,r),r?Li(n.scene.getElements(),[e]):n.setState((function(t){var n;return{selectedElementIds:Tp(Tp({},t.selectedElementIds),{},(n={},n[e.id]=!0,n))}})),r&&!o||Ap.resumeRecording(),n.setState({draggingElement:null,editingElement:null}),n.state.elementLocked&&kn(n.state.elementType)})),element:e}),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i(e.text)},t.prototype.getTextElementAtPosition=function(e,t){var n=this.getElementAtPosition(e,t);return n&&Pe(n)&&!n.isDeleted?n:null},t.prototype.getElementAtPosition=function(e,t){var n=this.getElementsAtPosition(e,t);if(n.length>1){var r=n[n.length-1];return mo(r,this.state,e,t)?n[n.length-2]:r}return 1===n.length?n[0]:null},t.prototype.getElementsAtPosition=function(e,t){var n,r,o=this;return n=this.scene.getElements(),r=function(n){return function(e,t,n,r){var o=10/t.zoom.value,i=[n,r];return yo(t,e)?vo(e,i,o):go(e,t,i)}(n,o.state,e,t)},n.filter((function(e){return!e.isDeleted&&r(e)}))},t.prototype.maybeCleanupAfterMissingPointerUp=function(e){null!==Fp&&Fp(e)},t.prototype.updateGestureOnPointerDown=function(e){Hp.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Hp.pointers.size&&(Hp.lastCenter=cu(Hp.pointers),Hp.initialScale=this.state.zoom.value,Hp.initialDistance=du(Array.from(Hp.pointers.values())))},t.prototype.initialPointerDownState=function(e){var t=Sn(e,this.state),n=sa(this.scene.getElements(),this.state),r=nt(n),o=r[0],i=r[1],a=r[2],s=r[3];return{origin:t,originInGrid:On(Ge(t.x,t.y,this.state.gridSize)),scrollbars:ia($p,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Tp({},t),originalElements:this.scene.getElements().reduce((function(e,t){return e.set(t.id,Ir(t)),e}),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(a+o)/2,y:(s+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null}}},t.prototype.handleDraggingScrollBar=function(e,t){var n=this;if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;jp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;var r=An((function(e){e.target instanceof HTMLElement&&n.handlePointerMoveOverScrollbars(e,t)})),o=An((function(){jp=!1,kn(n.state.elementType),Fp=null,n.setState({cursorButton:"up"}),n.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(s.Ks.POINTER_MOVE,r),window.removeEventListener(s.Ks.POINTER_UP,o)}));return Fp=o,window.addEventListener(s.Ks.POINTER_MOVE,r),window.addEventListener(s.Ks.POINTER_UP,o),!0},t.prototype.isASelectedElement=function(e){return null!=e&&this.state.selectedElementIds[e.id]},t.prototype.isHittingCommonBoundingBoxOfSelectedElements=function(e,t){if(t.length<2)return!1;var n=10/this.state.zoom.value,r=nt(t),o=r[0],i=r[1],a=r[2],s=r[3];return e.x>o-n&&e.xi-n&&e.y0){var d=Ge(o.x-e.drag.offset.x,o.y-e.drag.offset.y,t.state.gridSize),u=d[0],p=d[1],h=[Math.abs(o.x-e.origin.x),Math.abs(o.y-e.origin.y)],f=h[0],m=h[1],g=n.shiftKey;if(function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=nt(t),c={x:n-l[0],y:r-l[1]};t.forEach((function(n){var r,o;if(i){var l=i&&as,u=e.originalElements.get(n.id);r=l&&u?u.x:n.x+c.x,o=d&&u?u.y:n.y+c.y}else r=n.x+c.x,o=n.y+c.y;cr(n,{x:r,y:o}),yi(n,{simultaneouslyUpdated:t})}))}(e,c,u,p,t.scene,g,f,m),t.maybeSuggestBindingForAll(c),n.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;for(var y=[],v=[],b=new Map,x=new Map,w=e.hit.element,k=0,_=t.scene.getElementsIncludingDeleted();k<_.length;k++){var M=_[k];if(t.state.selectedElementIds[M.id]||M.id===(null==w?void 0:w.id)&&e.hit.wasAddedToSelection){var S=Nr(t.state.editingGroupId,b,M),E=Ge(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,t.state.gridSize),z=E[0],C=E[1];cr(S,{x:S.x+(z-u),y:S.y+(C-p)}),y.push(S),v.push(M),x.set(M.id,S.id)}else y.push(M)}var L=Lp(y,v);zi(L,v,x,"duplicatesServeAsOld"),t.scene.replaceAllElements(L)}return}}var O=t.state.draggingElement;if(O){if(Ie(O)){e.drag.hasOccurred=!0;var T=O.points,A=void 0,P=void 0;"draw"===O.type?(A=o.x-O.x,P=o.y-O.y):(A=a-O.x,P=l-O.y),cn(n)&&2===T.length&&(A=(r=pr(t.state.elementType,A,P)).width,P=r.height),1===T.length?cr(O,{points:Lp(T,[[A,P]])}):T.length>1&&("draw"===O.type?cr(O,{points:D(Lp(T,[[A,P]]),.7/t.state.zoom.value)}):cr(O,{points:Lp(T.slice(0,-1),[[A,P]])})),Re(O)&&t.maybeSuggestBindingForLinearElementAtCursor(O,"end",o,t.state.startBoundElement)}else e.lastCoords.x=o.x,e.lastCoords.y=o.y,t.maybeDragNewGenericElement(e,n);if("selection"===t.state.elementType){var I=t.scene.getElements();!n.shiftKey&&aa(I,t.state)&&t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null});var N=function(e,t){var n=Ye(t),r=n[0],o=n[1],i=n[2],a=n[3];return e.filter((function(e){var t=tt(e),n=t[0],s=t[1],l=t[2],c=t[3];return"selection"!==e.type&&r<=n&&o<=s&&i>=l&&a>=c}))}(I,O);t.setState((function(e){return kr(Tp(Tp({},e),{},{selectedElementIds:Tp(Tp({},e.selectedElementIds),N.reduce((function(e,t){return e[t.id]=!0,e}),{}))}),t.scene.getElements())}))}}}}}))},t.prototype.handlePointerMoveOverScrollbars=function(e,t){if(t.scrollbars.isOverHorizontal){var n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){var o=e.clientY,i=o-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-i/this.state.zoom.value}),t.lastCoords.y=o,!0}return!1},t.prototype.onPointerUpFromPointerDownHandler=function(e){var t=this;return An((function(n){var r=t.state,o=r.draggingElement,i=r.resizingElement,a=r.multiElement,l=r.elementType,c=r.elementLocked,d=r.isResizing,u=r.isRotating;if(t.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:a||Pe(t.state.editingElement)?t.state.editingElement:null}),t.savePointer(n.clientX,n.clientY,"up"),t.state.editingLinearElement){var p=ti.handlePointerUp(n,t.state.editingLinearElement,t.state);p!==t.state.editingLinearElement&&t.setState({editingLinearElement:p,suggestedBindings:[]})}if(Fp=null,window.removeEventListener(s.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(s.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(s.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(s.Ks.KEYUP,e.eventListeners.onKeyUp),"draw"!==(null==o?void 0:o.type))if(Ie(o)){o.points.length>1&&Ap.resumeRecording();var h=Sn(n,t.state);e.drag.hasOccurred||!o||a?e.drag.hasOccurred&&!a&&(oi(t.state)&&Re(o)&&ci(o,t.state,t.scene,h),t.setState({suggestedBindings:[],startBoundElement:null}),c||"draw"===l?t.setState((function(e){var n;return{draggingElement:null,selectedElementIds:Tp(Tp({},e.selectedElementIds),{},(n={},n[t.state.draggingElement.id]=!0,n))}})):(wn(),t.setState((function(e){var n;return{draggingElement:null,elementType:"selection",selectedElementIds:Tp(Tp({},e.selectedElementIds),{},(n={},n[t.state.draggingElement.id]=!0,n))}})))):(cr(o,{points:Lp(o.points,[[h.x-o.x,h.y-o.y]])}),t.setState({multiElement:o,editingElement:t.state.draggingElement}))}else{if("selection"!==l&&o&&ur(o))return t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().slice(0,-1)),void t.setState({draggingElement:null});o&&cr(o,hr(o)),i&&Ap.resumeRecording(),i&&ur(i)&&t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==i.id})));var f=e.hit.element;if(f&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection)if(n.shiftKey)if(t.state.selectedElementIds[f.id])if(br(t.state,f)){var m=f.groupIds.flatMap((function(e){return Mr(t.scene.getElements(),e)})).map((function(e){var t;return(t={})[e.id]=!1,t})).reduce((function(e,t){return Tp(Tp({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:Tp(Tp({},e.selectedElementIds),f.groupIds.map((function(e){var t;return(t={})[e]=!1,t})).reduce((function(e,t){return Tp(Tp({},e),t)}),{})),selectedElementIds:Tp(Tp({},e.selectedElementIds),m)}}))}else t.setState((function(e){var t;return{selectedElementIds:Tp(Tp({},e.selectedElementIds),{},(t={},t[f.id]=!1,t))}}));else t.setState((function(e){var t;return{selectedElementIds:Tp(Tp({},e.selectedElementIds),{},(t={},t[f.id]=!0,t))}}));else t.setState((function(e){var n;return Tp({},kr(Tp(Tp({},e),{},{selectedElementIds:(n={},n[f.id]=!0,n)}),t.scene.getElements()))}));t.state.editingLinearElement||e.drag.hasOccurred||t.state.isResizing||!(f&&mo(f,t.state,e.origin.x,e.origin.y)||!f&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!c&&"draw"!==l&&o&&t.setState((function(e){var t;return{selectedElementIds:Tp(Tp({},e.selectedElementIds),{},(t={},t[o.id]=!0,t))}})),("selection"!==l||aa(t.scene.getElements(),t.state))&&Ap.resumeRecording(),(e.drag.hasOccurred||d||u)&&(oi(t.state)?si:hi)(sa(t.scene.getElements(),t.state)),c||"draw"===l?t.setState({draggingElement:null,suggestedBindings:[]}):(wn(),t.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}else t.actionManager.executeAction(yl)}))},t.prototype.maybeSuggestBindingForAll=function(e){var t,n,r=(t=e,n=new Set(t.map((function(e){return e.id}))),t.flatMap((function(e){return Re(e)?ki(e).filter((function(e){return!n.has(e.id)})):je(e)?Si(e).filter((function(e){return!n.has(e[0].id)})):[]})));this.setState({suggestedBindings:r})},t.prototype.clearSelection=function(e){this.setState((function(t){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&_r(e,t.editingGroupId)?t.editingGroupId:null}})),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})},t.prototype.getTextWysiwygSnappedToCenterPosition=function(e,t,n,r,o){var i=function(e,t,n){for(var r=null,o=e.length-1;o>=0;--o)if(!e[o].isDeleted){var i=Ye(e[o]),a=i[0],s=i[1],l=i[2],c=i[3];if(a0&&e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds})},this.pasteFromClipboard=An(function(){var t=(0,l.Z)((function(t){var n,r,o;return Cp(this,(function(i){switch(i.label){case 0:return n=document.activeElement,r=document.elementFromPoint(Ip,Np),!t||r instanceof HTMLCanvasElement&&!hn(n)?[4,Bc(t)]:[2];case 1:return(o=i.sent()).errorMessage?e.setState({errorMessage:o.errorMessage}):o.spreadsheet?e.setState({pasteDialog:{data:o.spreadsheet,shown:!0}}):o.elements?e.addElementsFromPasteOrLibrary(o.elements):o.text&&e.addTextFromPaste(o.text),e.selectShapeTool("selection"),null==t||t.preventDefault(),[2]}}))}));return function(e){return t.apply(this,arguments)}}()),this.addElementsFromPasteOrLibrary=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ip,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Np,o=nt(t),i=o[0],a=o[1],s=o[2],l=o[3],c=xn(i,s)/2,d=xn(a,l)/2,u=Sn({clientX:n,clientY:r},e.state),p=u.x-c,h=u.y-d,f=new Map,m=Ge(p,h,e.state.gridSize),g=m[0],y=m[1],v=new Map,b=t.map((function(t){var n=Nr(e.state.editingGroupId,f,t,{x:t.x+g-i,y:t.y+y-a});return v.set(t.id,n.id),n})),x=Lp(e.scene.getElementsIncludingDeleted(),b);zi(x,t,v),e.scene.replaceAllElements(x),Ap.resumeRecording(),e.setState(kr(Tp(Tp({},e.state),{},{isLibraryOpen:!1,selectedElementIds:b.reduce((function(e,t){return e[t.id]=!0,e}),{}),selectedGroupIds:{}}),e.scene.getElements()))},this.setAppState=function(t){e.setState(t)},this.removePointer=function(e){"touch"===e.pointerType&&Kp&&(clearTimeout(Kp),Kp=0,qp=!1),Hp.pointers.delete(e.pointerId)},this.toggleLock=function(){e.setState((function(e){return{elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType}}))},this.toggleZenMode=function(){e.actionManager.executeAction(tu)},this.toggleStats=function(){e.actionManager.executeAction(ou)},this.setScrollToCenter=function(t){e.setState(Tp({},da(Qi(t),e.state,e.canvas)))},this.clearToast=function(){e.setState({toastMessage:null})},this.updateScene=An((function(t){var n;t.commitToHistory&&Ap.resumeRecording(),null!==(n=t.appState)&&void 0!==n&&n.viewBackgroundColor&&e.setState({viewBackgroundColor:t.appState.viewBackgroundColor}),t.elements&&e.scene.replaceAllElements(t.elements),t.collaborators&&e.setState({collaborators:t.collaborators})})),this.onSceneUpdated=function(){e.setState({})},this.updateCurrentCursorPosition=An((function(e){Ip=e.x,Np=e.y})),this.onKeyDown=An((function(t){var n;if("Proxy"in window&&(!t.shiftKey&&/^[A-Z]$/.test(t.key)||t.shiftKey&&/^[a-z]$/.test(t.key))&&(t=new Proxy(t,{get:function(e,n){var r=e[n];return"function"==typeof r?r.bind(e):"key"===n?t.shiftKey?e.key.toUpperCase():e.key.toLowerCase():r}})),!(hn(t.target)&&t.key!==Kt||an(t.key)&&(n=t.target,n instanceof HTMLElement&&"wysiwyg"===n.dataset.type||n instanceof HTMLBRElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)||(t.key===qt&&e.setState({showHelpDialog:!0}),e.actionManager.handleKeyDown(t)||e.state.viewModeEnabled))){if(t[Bt]&&e.setState({isBindingEnabled:!1}),t.code===wt&&e.setState({isLibraryOpen:!e.state.isLibraryOpen}),an(t.key)){var r=e.state.gridSize&&(t.shiftKey?s.$e:e.state.gridSize)||(t.shiftKey?s.Iw:s.$e),o=e.scene.getElements().filter((function(t){return e.state.selectedElementIds[t.id]})),i=0,a=0;t.key===Dt?i=-r:t.key===Pt?i=r:t.key===It?a=-r:t.key===At&&(a=r),o.forEach((function(e){cr(e,{x:e.x+i,y:e.y+a}),yi(e,{simultaneouslyUpdated:o})})),e.maybeSuggestBindingForAll(o),t.preventDefault()}else if(t.key===$t){var l=sa(e.scene.getElements(),e.state);if(1===l.length&&Ie(l[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===l[0].id||(Ap.resumeRecording(),e.setState({editingLinearElement:new ti(l[0],e.scene)}));else if(1===l.length&&!Ie(l[0])){var c=l[0];return e.startTextEditing({sceneX:c.x+c.width/2,sceneY:c.y+c.height/2}),void t.preventDefault()}}else if(!t.ctrlKey&&!t.altKey&&!t.metaKey&&null===e.state.draggingElement){var d=function(e){var t=yu.find((function(t,n){return e===(n+1).toString()||("string"==typeof t.key?t.key===e:t.key.includes(e))}));return(null==t?void 0:t.value)||null}(t.key);d?e.selectShapeTool(d):t.key===Yt&&e.toggleLock()}t.key===Ft&&0===Hp.pointers.size&&(Rp=!0,document.documentElement.style.cursor=s.oc.GRABBING)}})),this.onKeyUp=An((function(t){if(t.key===Ft&&("selection"===e.state.elementType?wn():(kn(e.state.elementType),e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Rp=!1),t[Bt]||e.state.isBindingEnabled||e.setState({isBindingEnabled:!0}),an(t.key)){var n=sa(e.scene.getElements(),e.state);oi(e.state)?si(n):hi(n),e.setState({suggestedBindings:[]})}})),this.onGestureStart=An((function(t){t.preventDefault(),e.setState({selectedElementIds:{}}),Hp.initialScale=e.state.zoom.value})),this.onGestureChange=An((function(t){if(t.preventDefault(),2!==Hp.pointers.size){var n=Hp.initialScale;n&&e.setState((function(e){var r=e.zoom,o=e.offsetLeft,i=e.offsetTop;return{zoom:ya(va(n*t.scale),r,{left:o,top:i},{x:Ip,y:Np})}}))}})),this.onGestureEnd=An((function(t){t.preventDefault(),e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds}),Hp.initialScale=null})),this.startTextEditing=function(t){var n=t.sceneX,r=t.sceneY,o=t.insertAtParentCenter,i=void 0===o||o,a=e.getTextElementAtPosition(n,r),l=i&&e.getTextWysiwygSnappedToCenterPosition(n,r,e.state,e.canvas,window.devicePixelRatio),c=a||Ar({x:l?l.elementCenterX:n,y:l?l.elementCenterY:r,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness,text:"",fontSize:e.state.currentItemFontSize,fontFamily:e.state.currentItemFontFamily,textAlign:l?"center":e.state.currentItemTextAlign,verticalAlign:l?"middle":s.hs});e.setState({editingElement:c}),a?l&&"center"===c.textAlign||cr(c,{verticalAlign:s.hs}):(e.scene.replaceAllElements(Lp(e.scene.getElementsIncludingDeleted(),[c])),l||cr(c,{y:c.y-c.baseline/2})),e.setState({editingElement:c}),e.handleTextWysiwyg(c,{isExistingElement:!!a})},this.handleCanvasDoubleClick=function(t){if(!e.state.multiElement&&"selection"===e.state.elementType){var n=sa(e.scene.getElements(),e.state);if(1===n.length&&Ie(n[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===n[0].id||(Ap.resumeRecording(),e.setState({editingLinearElement:new ti(n[0],e.scene)}));else{wn();var r=Sn(t,e.state),o=r.x,i=r.y;if(wr(e.state).length>0){var a=e.getElementAtPosition(o,i),s=a&&function(e,t){return e.groupIds.find((function(e){return t[e]}))}(a,e.state.selectedGroupIds);if(s)return void e.setState((function(t){var n;return kr(Tp(Tp({},t),{},{editingGroupId:s,selectedElementIds:(n={},n[a.id]=!0,n),selectedGroupIds:{}}),e.scene.getElements())}))}wn(),t[Bt]||e.startTextEditing({sceneX:o,sceneY:i,insertAtParentCenter:!t.altKey})}}},this.handleCanvasPointerMove=function(t){e.savePointer(t.clientX,t.clientY,e.state.cursorButton),Hp.pointers.has(t.pointerId)&&Hp.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY});var n=Hp.initialScale;if(2===Hp.pointers.size&&Hp.lastCenter&&n&&Hp.initialDistance){var r=cu(Hp.pointers),o=r.x-Hp.lastCenter.x,i=r.y-Hp.lastCenter.y;Hp.lastCenter=r;var a=du(Array.from(Hp.pointers.values()))/Hp.initialDistance;e.setState((function(e){var t=e.zoom,s=e.scrollX,l=e.scrollY,c=e.offsetLeft,d=e.offsetTop;return{scrollX:s+o/t.value,scrollY:l+i/t.value,zoom:ya(va(n*a),t,{left:c,top:d},r),shouldCacheIgnoreZoom:!0}})),e.resetShouldCacheIgnoreZoomDebounced()}else Hp.lastCenter=Hp.initialDistance=Hp.initialScale=null;if(!(Rp||Bp||jp)){var l=ia($p,t.clientX-e.state.offsetLeft,t.clientY-e.state.offsetTop).isOverEither;e.state.draggingElement||e.state.multiElement||(l?wn():kn(e.state.elementType));var c=Sn(t,e.state),d=c.x,u=c.y;if(e.state.editingLinearElement&&!e.state.editingLinearElement.isDragging){var p=ti.handlePointerMove(t,d,u,e.state.editingLinearElement,e.state.gridSize);p!==e.state.editingLinearElement&&e.setState({editingLinearElement:p}),null!=p.lastUncommittedPoint?e.maybeSuggestBindingAtCursor(c):e.setState({suggestedBindings:[]})}if(Be(e.state.elementType)){var h=e.state.draggingElement;Re(h)?e.maybeSuggestBindingForLinearElementAtCursor(h,"end",c,e.state.startBoundElement):e.maybeSuggestBindingAtCursor(c)}if(e.state.multiElement){var f=e.state.multiElement,m=f.x,g=f.y,y=f.points,v=f.lastCommittedPoint,b=y[y.length-1];return kn(e.state.elementType),void(b===v?Fe(d-m,u-g,b[0],b[1])>=s.qx?cr(f,{points:Lp(y,[[d-m,u-g]])}):document.documentElement.style.cursor=s.oc.POINTER:y.length>2&&v&&Fe(d-m,u-g,v[0],v[1])1&&!l){var k=Go(nt(w),d,u,e.state.zoom,t.pointerType);if(k)return void(document.documentElement.style.cursor=Yo({transformHandleType:k}))}}else{var _=Zo(x,e.state,d,u,e.state.zoom,t.pointerType);if(_&&_.transformHandleType)return void(document.documentElement.style.cursor=Yo(_))}var M=e.getElementAtPosition(c.x,c.y);"text"===e.state.elementType?document.documentElement.style.cursor=Pe(M)?s.oc.TEXT:s.oc.CROSSHAIR:l?document.documentElement.style.cursor=s.oc.AUTO:M||e.isHittingCommonBoundingBoxOfSelectedElements(c,w)?document.documentElement.style.cursor=s.oc.MOVE:document.documentElement.style.cursor=s.oc.AUTO}}},this.handleTouchMove=function(e){qp=!0},this.handleCanvasPointerDown=function(t){if(t.persist(),e.maybeOpenContextMenuAfterPointerDownOnTouchDevices(t),e.maybeCleanupAfterMissingPointerUp(t),!Bp&&(e.setState({lastPointerDownWith:t.pointerType,cursorButton:"down"}),e.savePointer(t.clientX,t.clientY,"down"),!e.handleCanvasPanUsingWheelOrSpaceDrag(t)&&!(t.button!==s.Oh.MAIN&&t.button!==s.Oh.TOUCH||(e.updateGestureOnPointerDown(t),t.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),Hp.pointers.size>1)))){var n=e.initialPointerDownState(t);if(!e.handleDraggingScrollBar(t,n)&&(e.clearSelectionIfNotUsingSelection(),e.updateBindingEnabledOnPointerMove(t),!e.handleSelectionOnPointerDown(t,n)))if("text"!==e.state.elementType){"arrow"===e.state.elementType||"draw"===e.state.elementType||"line"===e.state.elementType?e.handleLinearElementOnPointerDown(t,e.state.elementType,n):e.createGenericElementOnPointerDown(e.state.elementType,n);var r=e.onPointerMoveFromPointerDownHandler(n),o=e.onPointerUpFromPointerDownHandler(n),i=e.onKeyDownFromPointerDownHandler(n),a=e.onKeyUpFromPointerDownHandler(n);Fp=o,e.state.viewModeEnabled||(window.addEventListener(s.Ks.POINTER_MOVE,r),window.addEventListener(s.Ks.POINTER_UP,o),window.addEventListener(s.Ks.KEYDOWN,i),window.addEventListener(s.Ks.KEYUP,a),n.eventListeners.onMove=r,n.eventListeners.onUp=o,n.eventListeners.onKeyUp=a,n.eventListeners.onKeyDown=i)}else e.handleTextOnPointerDown(t,n)}},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(t){"touch"===t.pointerType&&(qp=!1,Kp?qp=!0:Kp=window.setTimeout((function(){Kp=0,qp||e.openContextMenu({clientX:t.clientX,clientY:t.clientY})}),s.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=function(t){if(0!==Hp.pointers.size||!(t.button===s.Oh.WHEEL||t.button===s.Oh.MAIN&&Rp||e.state.viewModeEnabled))return!1;Bp=!0;var n=!1,r=/Linux/.test(window.navigator.platform);document.documentElement.style.cursor=s.oc.GRABBING;var o=t.clientX,i=t.clientY,a=An((function(t){var a=o-t.clientX,l=i-t.clientY;if(o=t.clientX,i=t.clientY,r&&!n&&(Math.abs(a)>1||Math.abs(l)>1)){n=!0;var c=function(e){document.body.removeEventListener(s.Ks.PASTE,c),e.stopPropagation()},d=function(){setTimeout((function(){document.body.removeEventListener(s.Ks.PASTE,c),window.removeEventListener(s.Ks.POINTER_UP,d)}),100)};document.body.addEventListener(s.Ks.PASTE,c),window.addEventListener(s.Ks.POINTER_UP,d)}e.setState({scrollX:e.state.scrollX-a/e.state.zoom.value,scrollY:e.state.scrollY-l/e.state.zoom.value})})),l=An(Fp=function(){Fp=null,Bp=!1,Rp||kn(e.state.elementType),e.setState({cursorButton:"up"}),e.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener(s.Ks.POINTER_MOVE,a),window.removeEventListener(s.Ks.POINTER_UP,l),window.removeEventListener(s.Ks.BLUR,l)});return window.addEventListener(s.Ks.BLUR,l),window.addEventListener(s.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(s.Ks.POINTER_UP,l),!0},this.clearSelectionIfNotUsingSelection=function(){"selection"!==e.state.elementType&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=function(t,n){if("selection"===e.state.elementType){var r=e.scene.getElements(),o=sa(r,e.state);if(1!==o.length||e.state.editingLinearElement)o.length>1&&(n.resize.handleType=Go(nt(o),n.origin.x,n.origin.y,e.state.zoom,t.pointerType));else{var i=Zo(r,e.state,n.origin.x,n.origin.y,e.state.zoom,t.pointerType);null!=i&&(e.setState({resizingElement:i.element}),n.resize.handleType=i.transformHandleType)}if(n.resize.handleType)document.documentElement.style.cursor=Yo({transformHandleType:n.resize.handleType}),n.resize.isResizing=!0,n.resize.offset=On(function(e,t,n,r){var o,i=1===t.length?Ye(t[0]):nt(t),a=i[0],s=i[1],l=i[2],c=i[3],d=(a+l)/2,u=(s+c)/2,p=1===t.length?t[0].angle:0;switch(n=(o=$e(n,r,d,u,-p))[0],r=o[1],e){case"n":return $e(n-(a+l)/2,r-s,0,0,p);case"s":return $e(n-(a+l)/2,r-c,0,0,p);case"w":return $e(n-a,r-(s+c)/2,0,0,p);case"e":return $e(n-l,r-(s+c)/2,0,0,p);case"nw":return $e(n-a,r-s,0,0,p);case"ne":return $e(n-l,r-s,0,0,p);case"sw":return $e(n-a,r-c,0,0,p);case"se":return $e(n-l,r-c,0,0,p);default:return[0,0]}}(n.resize.handleType,o,n.origin.x,n.origin.y)),1===o.length&&Ie(o[0])&&2===o[0].points.length&&(n.resize.arrowDirection=(d=n.resize.handleType,p=(u=o[0].points[1])[0],h=u[1],"nw"===d&&(p<0||h<0)||"ne"===d&&p>=0||"sw"===d&&p<=0||"se"===d&&(p>0||h>0)?"end":"origin"));else{var a;if(e.state.editingLinearElement){var s=ti.handlePointerDown(t,e.state,(function(t){return e.setState(t)}),Ap,n.origin);if(s.hitElement&&(n.hit.element=s.hitElement),s.didAddPoint)return!0}n.hit.element=null!==(a=n.hit.element)&&void 0!==a?a:e.getElementAtPosition(n.origin.x,n.origin.y),n.hit.allHitElements=e.getElementsAtPosition(n.origin.x,n.origin.y);var l=n.hit.element,c=n.hit.allHitElements.some((function(t){return e.isASelectedElement(t)}));if(null!==l&&c||t.shiftKey||n.hit.hasHitCommonBoundingBoxOfSelectedElements||e.clearSelection(l),null!=l){if(t[Bt])return e.setState((function(t){return Tp(Tp({},function(e,t){var n;return yr(yr({},e),{},{editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:(n={},n[t.id]=!0,n)})}(t,l)),{},{previousSelectedElementIds:e.state.selectedElementIds})})),!1;e.state.selectedElementIds[l.id]||(e.state.editingGroupId&&!_r(l,e.state.editingGroupId)&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),c||n.hit.hasHitCommonBoundingBoxOfSelectedElements||(e.setState((function(t){var n;return kr(Tp(Tp({},t),{},{selectedElementIds:Tp(Tp({},t.selectedElementIds),{},(n={},n[l.id]=!0,n))}),e.scene.getElements())})),n.hit.wasAddedToSelection=!0))}e.setState({previousSelectedElementIds:e.state.selectedElementIds})}}var d,u,p,h;return!1},this.handleTextOnPointerDown=function(t,n){var r;"text"!==(null===(r=e.state.editingElement)||void 0===r?void 0:r.type)&&(e.startTextEditing({sceneX:n.origin.x,sceneY:n.origin.y,insertAtParentCenter:!t.altKey}),wn(),e.state.elementLocked||e.setState({elementType:"selection"}))},this.handleLinearElementOnPointerDown=function(t,n,r){if(e.state.multiElement){var o=e.state.multiElement;if("line"===o.type&&He(o.points,e.state.zoom.value))return cr(o,{lastCommittedPoint:o.points[o.points.length-1]}),void e.actionManager.executeAction(yl);var i=o.x,a=o.y,l=o.lastCommittedPoint;if(o.points.length>1&&l&&Fe(r.origin.x-i,r.origin.y-a,l[0],l[1])1){if("rotation"===t)return qi(e,n,s,l,o,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return Ki(n,t,s,l),!0}return!1}(t,o,r,t.resize.arrowDirection,cn(n),sn(n),ln(n),s,l,t.resize.center.x,t.resize.center.y)&&(e.maybeSuggestBindingForAll(r),!0)},this.openContextMenu=function(t){var n,r=t.clientX,o=t.clientY,i=Sn({clientX:r,clientY:o},e.state),a=i.x,s=i.y,l=bd.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),c=xd.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),d="separator",u=dl(),p=e.scene.getElements(),h=e.getElementAtPosition(a,s),f=[];if(Dc&&p.length>0&&f.push(Gd),Ac&&p.length>0&&f.push(Zd),h)e.state.selectedElementIds[h.id]||e.setState({selectedElementIds:(n={},n[h.id]=!0,n)}),e.state.viewModeEnabled?ku({options:Lp([navigator.clipboard&&Vd],f),top:o,left:r,actionManager:e.actionManager,appState:e.state}):ku({options:Lp([u&&Ud,u&&navigator.clipboard&&Vd,u&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},u&&d],f,[d,dd,ud,d,l&&bd,c&&xd,(l||c)&&d,Sd,d,As,Ds,Ps,Is,d,qs,ks]),top:o,left:r,actionManager:e.actionManager,appState:e.state});else{var m=Lp(f,[void 0===e.props.gridModeEnabled&&Jd,void 0===e.props.zenModeEnabled&&tu,void 0===e.props.viewModeEnabled&&Ep,ou]);if(ku({options:m,top:o,left:r,actionManager:e.actionManager,appState:e.state}),e.state.viewModeEnabled)return;ku({options:[u&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},u&&navigator.clipboard&&d,Dc&&p.length>0&&Gd,Ac&&p.length>0&&Zd,(Dc&&p.length>0||Ac&&p.length>0)&&d,Bs,d,void 0===e.props.gridModeEnabled&&Jd,void 0===e.props.zenModeEnabled&&tu,void 0===e.props.viewModeEnabled&&Ep,ou],top:o,left:r,actionManager:e.actionManager,appState:e.state})}},this.handleWheel=An((function(t){if(t.preventDefault(),!Bp){var n=t.deltaX,r=t.deltaY,o=e.state,i=o.selectedElementIds,a=o.previousSelectedElementIds;if(t.metaKey||t.ctrlKey){var l=Math.sign(r),c=Math.abs(r);c>10&&(c=10),c*=l,0!==Object.keys(a).length&&setTimeout((function(){e.setState({selectedElementIds:a,previousSelectedElementIds:{}})}),1e3);var d=e.state.zoom.value-c/100;return d+=Math.log10(Math.max(1,e.state.zoom.value))*-l,d=Math.round(d*s.V4*100)/(100*s.V4),e.setState((function(e){var t=e.zoom,n=e.offsetLeft,r=e.offsetTop;return{zoom:ya(va(d),t,{left:n,top:r},{x:Ip,y:Np}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(i).length?i:a,shouldCacheIgnoreZoom:!0}})),void e.resetShouldCacheIgnoreZoomDebounced()}t.shiftKey?e.setState((function(e){var t=e.zoom;return{scrollX:e.scrollX-(r||n)/t.value}})):e.setState((function(e){var t=e.zoom,o=e.scrollX,i=e.scrollY;return{scrollX:o-n/t.value,scrollY:i-r/t.value}}))}})),this.savePointer=function(t,n,r){var o,i;if(t&&n){var a=Sn({clientX:t,clientY:n},e.state);isNaN(a.x)||isNaN(a.y),null===(o=(i=e.props).onPointerUpdate)||void 0===o||o.call(i,{pointer:a,button:r,pointersMap:Hp.pointers})}},this.resetShouldCacheIgnoreZoomDebounced=yn((function(){e.unmounted||e.setState({shouldCacheIgnoreZoom:!1})}),300)};"production"!==s.Vi.TEST&&"production"!==s.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(e){return this.app.scene.replaceAllElements(e)}},history:{configurable:!0,get:function(){return Ap}},library:{configurable:!0,value:Hc}}));const Up=Wp;n(8234),n(4651);var Zp=["initialData"],Gp=["initialData"],Xp=function(e){var t=e.width,n=e.height,r=e.offsetLeft,o=e.offsetTop,s=e.onChange,l=e.initialData,c=e.excalidrawRef,d=e.onCollabButtonClick,u=e.isCollaborating,h=e.onPointerUpdate,f=e.onExport,m=e.onExportToBackend,g=e.renderFooter,y=e.langCode,v=void 0===y?p.code:y,b=e.viewModeEnabled,x=e.zenModeEnabled,w=e.gridModeEnabled;return(0,i.useEffect)((function(){var e=function(e){"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),function(){document.removeEventListener("touchmove",e)}}),[]),a().createElement(S,{langCode:v},a().createElement(cl,null,a().createElement(Up,{width:t,height:n,offsetLeft:r,offsetTop:o,onChange:s,initialData:l,excalidrawRef:c,onCollabButtonClick:d,isCollaborating:u,onPointerUpdate:h,onExport:f,onExportToBackend:m,renderFooter:g,langCode:v,viewModeEnabled:b,zenModeEnabled:x,gridModeEnabled:w})))},Yp=function(e,t){e.initialData;var n=o(e,Zp),r=(t.initialData,o(t,Gp)),i=Object.keys(e),a=Object.keys(t);return i.length===a.length&&i.every((function(e){return n[e]===r[e]}))};Xp.defaultProps={lanCode:p.code};var Jp=(0,i.forwardRef)((function(e,t){return a().createElement(Xp,r({},e,{excalidrawRef:t}))}));const Qp=a().memo(Jp,Yp);n(6009);const eh=Qp},4698:t=>{t.exports=e},6207:e=>{e.exports=t}},s={};function l(e){if(s[e])return s[e].exports;var t=s[e]={id:e,exports:{}};return a[e](t,t.exports,l),t.exports}return l.m=a,l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);l.r(o);var i={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,l.d(o,i),o},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,n)=>(l.f[n](e,t),t)),[])),l.u=e=>"excalidraw-assets/"+{9:"image",43:"i18n-de-DE-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",401:"i18n-sk-SK-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",583:"i18n-uk-UA-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[e]+"-"+{9:"f585fc9bc583940d6d64",43:"6c9a6530390f264cca9c",60:"fcb7c4f67345da70f193",62:"5e6394067c80cf6257fc",137:"3ba3a33502526e73bb49",149:"00ee5ed49bb8a0be27b7",164:"0f48e0ea83ff24dfc18c",196:"c2ac46337fe0058749da",213:"c8788bf3cd5ae64f3934",242:"b5dd91fce02e82edc3fe",246:"c7ad17e87f386e94bc27",262:"9fe5759ecbe50cd3d98b",280:"5c1cea1ca05eebe7782e",304:"42894347f4a0a1cd3e2d",317:"c9151b33ff2bf05e0717",351:"d5a98babbbc2b19b5426",364:"a4b21ae9c3a79367f8ac",381:"b93e36d19e5188e46e2e",384:"dfdcd793fe2a0371d3e8",401:"90689b793169b7f3ac00",465:"bd83830cede1a946d86a",472:"753a78ab1bdf1fba2a81",491:"3a6bf4237351abb65468",526:"76b8149b40916ac9dbe5",558:"2c0b3393a63e5b331d23",583:"02b7843d840fee0c2401",661:"0079c31f82d348afcbad",698:"95857ca2878d8fe26649",710:"2d28643d4f5c290181c2",736:"01adc7078c1c9fa90f39",752:"c0798a444a39c820be7c",852:"a9ad2a5fc431005434fa",869:"073b37fd2b37e6fffbcb",920:"0eb63dbc270dff8049df",933:"e5d07e5068df8db9ae05"}[e]+".js",l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},i="Excalidraw:",l.l=(e,t,n,r)=>{if(o[e])o[e].push(t);else{var a,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(h);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.p="",(()=>{var e={163:0};l.f.j=(t,n)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>{r=e[t]=[n,o]}));n.push(r[2]=o);var i=l.p+l.u(t),a=new Error;l.l(i,(n=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{for(var r,o,i=n[0],a=n[1],s=n[2],c=0,d=[];c=0)return;a[r]="set-cookie"===r?(a[r]?a[r]:[]).concat([o]):a[r]?a[r]+", "+o:o}})),a):a}}(Nn),Nn.exports.default;var Rn={exports:{}};!function(e){var t=bn.exports;e.exports=t.isStandardBrowserEnv()?function(){var e,n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var t=e;return n&&(r.setAttribute("href",t),t=r.href),r.setAttribute("href",t),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(n){var r=t.isString(n)?o(n):n;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}}(Rn),Rn.exports.default,function(e){var t=bn.exports,n=On.exports,r=An.exports,o=kn.exports,i=Dn.exports,a=Nn.exports,s=Rn.exports,l=Tn.exports;e.exports=function(e){return new Promise((function(c,d){var u=e.data,p=e.headers,h=e.responseType;t.isFormData(u)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(m+":"+g)}var y=i(e.baseURL,e.url);function v(){if(f){var t="getAllResponseHeaders"in f?a(f.getAllResponseHeaders()):null,r={data:h&&"text"!==h&&"json"!==h?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:t,config:e,request:f};n(c,d,r),f=null}}if(f.open(e.method.toUpperCase(),o(y,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(d(l("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){d(l("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),d(l(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},t.isStandardBrowserEnv()){var b=(e.withCredentials||s(y))&&e.xsrfCookieName?r.read(e.xsrfCookieName):void 0;b&&(p[e.xsrfHeaderName]=b)}"setRequestHeader"in f&&t.forEach(p,(function(e,t){void 0===u&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),t.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),h&&"json"!==h&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),d(e),f=null)})),u||(u=null),f.send(u)}))}}(Ln),Ln.exports.default,function(e){var t=bn.exports,n=zn.exports,r=Cn.exports,o={"Content-Type":"application/x-www-form-urlencoded"};function i(e,n){!t.isUndefined(e)&&t.isUndefined(e["Content-Type"])&&(e["Content-Type"]=n)}var a,s={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(a=Ln.exports),a),transformRequest:[function(e,r){return n(r,"Accept"),n(r,"Content-Type"),t.isFormData(e)||t.isArrayBuffer(e)||t.isBuffer(e)||t.isStream(e)||t.isFile(e)||t.isBlob(e)?e:t.isArrayBufferView(e)?e.buffer:t.isURLSearchParams(e)?(i(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):t.isObject(e)||r&&"application/json"===r["Content-Type"]?(i(r,"application/json"),function(e,n,r){if(t.isString(e))try{return(n||JSON.parse)(e),t.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var n=this.transitional,o=n&&n.silentJSONParsing,i=n&&n.forcedJSONParsing,a=!o&&"json"===this.responseType;if(a||i&&t.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw r(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},t.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),t.forEach(["post","put","patch"],(function(e){s.headers[e]=t.merge(o)})),e.exports=s}(En),En.exports.default,function(e){var t=bn.exports,n=En.exports;e.exports=function(e,r,o){var i=this||n;return t.forEach(o,(function(t){e=t.call(i,e,r)})),e}}(Sn),Sn.exports.default;var Bn={exports:{}};!function(e){e.exports=function(e){return!(!e||!e.__CANCEL__)}}(Bn),Bn.exports.default,function(e){var t=bn.exports,n=Sn.exports,r=Bn.exports,o=En.exports;function i(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return i(e),e.headers=e.headers||{},e.data=n.call(e,e.data,e.headers,e.transformRequest),e.headers=t.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),t.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return i(e),t.data=n.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return r(t)||(i(e),t&&t.response&&(t.response.data=n.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}}(Mn),Mn.exports.default;var jn={exports:{}};!function(e){var t=bn.exports;e.exports=function(e,n){n=n||{};var r={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function l(e,n){return t.isPlainObject(e)&&t.isPlainObject(n)?t.merge(e,n):t.isPlainObject(n)?t.merge({},n):t.isArray(n)?n.slice():n}function c(o){t.isUndefined(n[o])?t.isUndefined(e[o])||(r[o]=l(void 0,e[o])):r[o]=l(e[o],n[o])}t.forEach(o,(function(e){t.isUndefined(n[e])||(r[e]=l(void 0,n[e]))})),t.forEach(i,c),t.forEach(a,(function(o){t.isUndefined(n[o])?t.isUndefined(e[o])||(r[o]=l(void 0,e[o])):r[o]=l(void 0,n[o])})),t.forEach(s,(function(t){t in n?r[t]=l(e[t],n[t]):t in e&&(r[t]=l(void 0,e[t]))}));var d=o.concat(i).concat(a).concat(s),u=Object.keys(e).concat(Object.keys(n)).filter((function(e){return-1===d.indexOf(e)}));return t.forEach(u,c),r}}(jn),jn.exports.default;var $n={exports:{}},Kn={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]};!function(e){var t=Kn,n={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){n[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var r={},o=t.version.split(".");function i(e,t){for(var n=t?t.split("."):o,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]0;){var i=r[o],a=t[i];if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new TypeError("option "+i+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:n}}($n),$n.exports.default,function(e){var t=bn.exports,n=kn.exports,r=_n.exports,o=Mn.exports,i=jn.exports,a=$n.exports,s=a.validators;function l(e){this.defaults=e,this.interceptors={request:new r,response:new r}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=i(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&a.assertOptions(t,{silentJSONParsing:s.transitional(s.boolean,"1.0.0"),forcedJSONParsing:s.transitional(s.boolean,"1.0.0"),clarifyTimeoutError:s.transitional(s.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var l,c=[];if(this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)})),!r){var d=[o,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(c),l=Promise.resolve(e);d.length;)l=l.then(d.shift(),d.shift());return l}for(var u=e;n.length;){var p=n.shift(),h=n.shift();try{u=p(u)}catch(e){h(e);break}}try{l=o(u)}catch(e){return Promise.reject(e)}for(;c.length;)l=l.then(c.shift(),c.shift());return l},l.prototype.getUri=function(e){return e=i(this.defaults,e),n(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(i(n||{},{method:e,url:t,data:(n||{}).data}))}})),t.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(i(r||{},{method:e,url:t,data:n}))}})),e.exports=l}(wn),wn.exports.default;var qn={exports:{}};!function(e){function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t}(qn),qn.exports.default;var Fn={exports:{}};!function(e){var t=qn.exports;function n(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;e((function(e){r.reason||(r.reason=new t(e),n(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var e,t=new n((function(t){e=t}));return{token:t,cancel:e}},e.exports=n}(Fn),Fn.exports.default;var Hn={exports:{}};!function(e){e.exports=function(e){return function(t){return e.apply(null,t)}}}(Hn),Hn.exports.default;var Wn={exports:{}};!function(e){e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}(Wn),Wn.exports.default,function(e){var t=bn.exports,n=xn.exports,r=wn.exports,o=jn.exports;function i(e){var o=new r(e),i=n(r.prototype.request,o);return t.extend(i,r.prototype,o),t.extend(i,o),i}var a=i(En.exports);a.Axios=r,a.create=function(e){return i(o(a.defaults,e))},a.Cancel=qn.exports,a.CancelToken=Fn.exports,a.isCancel=Bn.exports,a.all=function(e){return Promise.all(e)},a.spread=Hn.exports,a.isAxiosError=Wn.exports,e.exports=a,e.exports.default=a}(vn),vn.exports.default,function(e){e.exports=vn.exports}(yn);var Vn,Un,Zn,Gn=yn.exports.default,Xn=null===(Zn=null===(Un=null===(Vn=document.cookie)||void 0===Vn?void 0:Vn.split("; "))||void 0===Un?void 0:Un.find((function(e){return e.startsWith("cpm-sso-token=")})))||void 0===Zn?void 0:Zn.split("=")[1]; /*! js-cookie v3.0.5 | MIT */ function Yn(e){for(var t=1;tnew Promise((t=>{setTimeout((()=>{t()}),e)}));class er extends Error{}const tr=(e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;rtr;function rr(e){let t=Object.entries(e).map((([e,t])=>`${e}=${t}`)).join("; ");return t+="; Secure",t}const or=e=>{try{const t=(e=>{const t={};return e.split(";").forEach((e=>{const[n,r]=e.split("=").map((e=>e.trim()));t[n]=r})),t})(document.cookie);return t[e]?t[e]:null}catch(t){return console.error(`Failed to parse the '${e}' cookie lock. Continuing as if the cookie were null.`),null}},ir=e=>{document.cookie=rr({[e]:"",expires:"Thu, 01 Jan 1970 00:00:00 GMT",path:"/",domain:".cpm.org"})},ar=async e=>{for(;or(e);)await Qn(500)},sr=async(e,{lockClaim:t=nr(),hold:n=!1}={})=>(console.log(`Attempting to Acquire the Cookie Lock with Lock Key: '${e}' and Claim: '${t}'`),new Promise((async(r,o)=>{let i=or(e);console.log(`Current Lock Claim: '${i}'`);const a=async()=>{console.log(`Lock Taken Error: Another Claim has been made '${i}', so the '${t}' claim could not be established.`),n&&(console.log("Waiting for the claim to expire...'"),await ar(e)),console.log("Rejecting with LockTakenError.'"),o(new er)};if(i)a();else if(!i){console.log("The Lock is Free!'"),((e,t)=>{console.log(`Claiming Lock with Lock Key: '${e}' and Lock Claim: '${t}'`);const n=new Date;n.setTime(n.getTime()+5e3);const r=t,o=rr({[e]:r,expires:n.toUTCString(),path:"/",domain:".cpm.org",SameSite:"None"});document.cookie=o,console.log(`Added Cookie with Value: '${o}'`)})(e,t),console.log("Tentatively Claimed the Lock. Verifying Claim...'"),await new Promise((e=>{setTimeout((()=>{e()}),100)})),i=or(e);return i?t===i?(console.log(`Lock Claim has been Verified for this Claim: '${t}'`),void r()):void a():(console.log("Lock Could Not be Set: This is likely a cookie related issue. Make sure the cookie can be set.'"),void o(new er))}}))),lr="CPM_REFRESH_LOCK";class cr extends Error{}class dr extends Error{}const ur=e=>{let t;try{if(!e)throw console.error("Missing Access Token Error"),new dr;return t=me(e,{payload:!0}),t}catch(e){throw console.error("Invalid Access Token Error: ",e),new dr}},pr=()=>Jn.get("cpm-sso-token"),hr=()=>Jn.get("cpm-sso-csrf-token");class fr extends Error{}class mr extends Error{}class gr extends Error{}const yr=async(e,t,n=!1)=>{try{await sr(lr,{hold:n});try{const t=await(async e=>{console.log("Refreshing Session");const t=hr();if(!t)throw console.error("No CSRF Token Available"),new gr;const n=await fetch(`${e}/api/v1/refresh`,{credentials:"include",method:"post",headers:{"X-CSRF-TOKEN":t}});if(401===n.status)throw new fr;if(200===n.status){const e=await n.json(),t=pr();return console.log("Refresh Complete",{json:e,result:n,cookie:t,status:null==n?void 0:n.status}),pr()}throw new mr})(e);return ir(lr),t}catch(n){n instanceof fr?(ir(lr),console.error("Bad Refresh Error"),t&&(window.location.href=e)):(console.error("Unknown Refresh Error"),ir(lr))}}catch(e){e instanceof er?console.log("Failed to Acquire Refresh Lock: A Refresh is already in progress on another tab."):console.log("Failed to Acquire Refresh Lock - An unknown error occurred while attempting to acquire the refresh lock.")}},vr=()=>!!hr()?"refresh":"basic",br=async({redirect:e,ssoUrl:t,skipInitial:n,callback:r})=>{let o;console.log("Refresh Heartbeat");const i=vr();try{const e=pr();o=ur(e)}catch(n){return"basic"===i?(console.warn("Basic Session Detected with an Invalid Access Token"),void((e,t)=>{if(console.warn("Handling Redirect"),e)if(t)console.log("Redirecting to SSO"),window.location.href=t;else if(!t)throw console.error("Failed to Redirect: No SSL URL is defined."),new cr})(e,t)):(console.log("Refresh Session Detected with an Invalid Access Token. Attempting refresh..."),await yr(t,e),r&&r(),void setTimeout((()=>br({redirect:e,ssoUrl:t,callback:r,skipInitial:!1})),3e4))}if("basic"===i)return void console.log("Basic Session: Not registering refresh timeout for non refresh enabled user. (no csrf token)");const a=(e=>{const t=(new Date).getTime();return 1e3*e.exp-18e5-t})(o);!n&&a<=0&&(await yr(t,e),r&&r()),setTimeout((()=>br({redirect:e,ssoUrl:t,callback:r,skipInitial:!1})),3e4)};var xr,wr;V({accessToken:pr()}),"ebooks.cpm.org"===window.location.host||"ebooks-mn.cpm.org"===window.location.host?(xr="https://sso.cpm.org",wr="https://cdp-hermes.cpm.org/api"):(xr="https://sso-test.cpm.org",wr="https://cdp-hermes-test.cpm.org/api"),br({redirect:!1,ssoUrl:xr,callback:function(){console.log("eWorkspace Refresh Timeout: Refresh Succeeded!")}});var kr=Gn.create({baseURL:wr,headers:{Authorization:"Bearer ".concat(Xn)}});(({axiosInst:e,ssoUrl:t,callback:n,redirect:r})=>{"basic"!==vr()?e.interceptors.request.use((async e=>{!!or(lr)&&await ar(lr);let o=pr(),i=!1;if(o){try{ur(o)}catch(e){i=!0}try{const e=o&&(e=>{const t=1e3*ur(e).exp;return(new Date).getTime()>=t})(o);e&&(i=!0)}catch(e){i=!0}}else i=!0;return i&&(await yr(t,r,!0),o=pr()),o&&n&&n(o,e),e})):console.log("Not registering refresh interceptor for non refresh enabled user. (no csrf token)")})({axiosInst:kr,ssoUrl:xr,callback:function(){console.log("eWorkspace Axios Interceptor: Refresh Succeeded!")}}),kr.interceptors.request.use((function(e){var t=pr();return t&&(e.headers.Authorization="Bearer ".concat(t)),e}),(function(e){return console.error("Failed to set the Bearer Token for the eWorkspace Hermes request."),Promise.reject(e)}));var _r,Mr=function(e,t){return n(void 0,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:n={context:{curriculumKey:e,lesson:t}},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,kr.post("/eworkspace/owner/records",n)];case 2:return[2,r.sent().data];case 3:throw o=r.sent(),console.error("Error fetching eWorkspace records:",o),o;case 4:return[2]}}))}))},Sr=function(e,t){return n(void 0,void 0,void 0,(function(){var n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,kr.post("/eworkspace/owner/container/".concat(e,"/submission"),t)];case 1:return[2,r.sent().data];case 2:throw n=r.sent(),console.error("Error posting submission:",n),n;case 3:return[2]}}))}))},Er=function(e,t,o){return n(void 0,void 0,void 0,(function(){var n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,kr.patch("/eworkspace/owner/record/".concat(e,"/submission/").concat(t),o)];case 1:return[2,r.sent().data];case 2:throw n=r.sent(),console.error("Error updating submission:",n),n;case 3:return[2]}}))}))},zr=function(e){var t=[];return["image/jpeg","image/png"].includes(e.type)||t.push("Unsupported image format. Please upload a JPEG or PNG file."),e.size>5242880&&t.push("The image is too large. Please ensure the file size is under 5MB."),t},Cr="#ED4F55",Lr="#BCC1CD",Or="#EFF1F8",Tr="#ffffff",Ar="#233364",Dr=function(i){var a,s,l=i.addSubmission,c=i.submission,d=i.eWorkspace,u=c.createdAt,p=c._id,h=c.content,f=d.user,m=d._id,g="STUDENT"===f.role?"STUDENT_ANSWER":"TEACHER_FEEDBACK",y=Oe(!1),v=y[0],b=y[1],x=Oe(!1),w=x[0],k=x[1],_=Oe(""),M=_[0],E=_[1],z=Oe(void 0),C=z[0],L=z[1],O=Oe(void 0),T=O[0],A=O[1],D=Oe(""),P=D[0],I=D[1],N=Oe(""),R=N[0],B=N[1],j=Oe([]),$=j[0],K=j[1],q=Pe(!1),F=Pe(null),H=function(){switch(k(!0),h.contentType){case"CANVAS":I(h.mediaContent.canvas);break;case"JSON_PROSEMIRROR":E(h.mediaContent.doc);break;case"PLAIN_TEXT":E(h.mediaContent.text);break;case"CALCULATOR":B(h.mediaContent.data)}},W=function(){k(!1),I(""),E(""),B(""),L(void 0),F&&F.current&&(F.current.value=""),K([])},V=function(){var e;switch(K([]),h.contentType){case"CANVAS":e={version:"1.0",canvas:P};break;case"IMAGE_FILE":e={data:C};break;case"JSON_PROSEMIRROR":case"PLAIN_TEXT":e={version:"1.0",doc:M};break;case"CALCULATOR":e={data:R}}var t={content:{contentType:h.contentType,mediaContent:e},reviewed:!1};if("IMAGE_FILE"===h.contentType&&e){var n=new FormData;n.append("image",e.data),n.append("content",JSON.stringify(t.content)),n.append("reviewed",JSON.stringify(t.reviewed)),Er(m,p,n).then((function(e){e?(l&&l(e),W(),b(!1)):(console.error("Received undefined or malformed submission payload:",e),K((function(e){return o(o([],e,!0),["We encountered a problem updating your submission. Please try again."],!1)})))})).catch((function(e){console.error("Error during submission:",e),K((function(e){return o(o([],e,!0),["We encountered a problem updating your submission. Please try again."],!1)}))}))}else Er(m,p,t).then((function(e){e?(l&&l(e),W(),b(!1)):(console.error("Received undefined or malformed submission payload:",e),K((function(e){return o(o([],e,!0),["We encountered a problem updating your submission. Please try again."],!1)})))})).catch((function(e){console.error("Error during submission:",e),K((function(e){return o(o([],e,!0),["We encountered a problem updating your submission. Please try again."],!1)}))}))},U=function(){F&&F.current&&F.current.click(),K([])},Z=function(e){return new Promise((function(t){rn.imageFileResizer(e,1024,786,"JPEG",70,0,(function(e){return t(e)}),"file")}))},X=function(e){return'{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"'.concat(e,'"}]}]}')};return Ae((function(){P&&q.current&&V()}),[P]),Ae((function(){return C&&A(URL.createObjectURL(C)),function(){T&&(URL.revokeObjectURL(T),A(void 0))}}),[C]),G(S,{children:[G("tr",t({id:"".concat(p),class:"eWorkspace-entry ".concat(g," ").concat(h.contentType),onClick:function(){b((function(e){return!e}))}},{children:[G("td",{children:mn(u)}),G("td",{children:"STUDENT_ANSWER"===g?"Student Answer":"Teacher Feedback"}),G("td",{children:[f.firstName," ",f.lastName]}),G("td",t({id:"eWorkspace-table-chevron"},{children:G("button",t({class:"eWorkspace-icon-button"},{children:G("i",{class:"fas fa-chevron-down","aria-hidden":"true"})}))}))]})),v&&G("tr",t({class:"eWorkspace-entry-content"},{children:G("td",t({colSpan:4},{children:w&&"IMAGE_BASE64"!==h.contentType?G("div",t({class:"eWorkspace-entry-inner"},{children:G("div",t({class:"eWorkspace-entry-inner-body"},{children:[w&&G(S,{children:[$.length>0&&G("div",t({style:{color:Cr,padding:"10px 15px",border:"1px solid ".concat(Cr),margin:"10px 0",borderRadius:"5px"}},{children:G("ul",t({style:{margin:0,padding:0,listStyleType:"none"}},{children:$.map((function(e,n){return G("li",t({style:{display:"flex",alignItems:"flex-start",gap:"5px"}},{children:[G("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18",width:"18",height:"18",style:{minWidth:"18px",minHeight:"18px",marginTop:"3px"}},{children:G("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 2.45455C5.38505 2.45455 2.45455 5.38505 2.45455 9C2.45455 12.615 5.38505 15.5455 9 15.5455C12.615 15.5455 15.5455 12.615 15.5455 9C15.5455 5.38505 12.615 2.45455 9 2.45455ZM1 9C1 4.58172 4.58172 1 9 1C13.4183 1 17 4.58172 17 9C17 13.4183 13.4183 17 9 17C4.58172 17 1 13.4183 1 9ZM9 5.36364C9.40166 5.36364 9.72727 5.68925 9.72727 6.09091V9C9.72727 9.40166 9.40166 9.72727 9 9.72727C8.59834 9.72727 8.27273 9.40166 8.27273 9V6.09091C8.27273 5.68925 8.59834 5.36364 9 5.36364ZM8.27273 11.9091C8.27273 11.5074 8.59834 11.1818 9 11.1818H9.00727C9.40894 11.1818 9.73455 11.5074 9.73455 11.9091C9.73455 12.3108 9.40894 12.6364 9.00727 12.6364H9C8.59834 12.6364 8.27273 12.3108 8.27273 11.9091Z",fill:Cr})})),e]}),n)}))}))})),"CANVAS"===h.contentType&&G(pn,{initialData:h.mediaContent.canvas,handleCancel:W,onExport:function(e){return I(e),q.current=!0,e}}),"JSON_PROSEMIRROR"===h.contentType&&G(tn,{setText:E,document:h.mediaContent.doc}),"PLAIN_TEXT"===h.contentType&&((null===(a=h.mediaContent.text)||void 0===a?void 0:a.includes('"type": "doc"'))?G(tn,{setText:E,document:h.mediaContent.text}):G(tn,{setText:E,document:X(h.mediaContent.text)})),"CALCULATOR"===h.contentType&&G(gn,{document:h.mediaContent.data,setCalculator:B}),"IMAGE_FILE"===h.contentType&&G(S,{children:[G("div",t({onClick:U,class:"eWorkspace-btn eWorkspace-btn-primary",style:{width:"fit-content",cursor:"pointer",marginBottom:"20px"}},{children:"Upload New Photo"})),G("input",{type:"file",accept:"image/jpeg, image/png",onInput:function(e){return n(void 0,void 0,void 0,(function(){var t,n,i,a,s;return r(this,(function(r){switch(r.label){case 0:if(!(t=null===(s=e.currentTarget.files)||void 0===s?void 0:s[0]))return[2];if((n=zr(t)).length>0)return K((function(e){return o(o([],e,!0),n,!0)})),L(void 0),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Z(t)];case 2:return i=r.sent(),L(i),[3,4];case 3:return a=r.sent(),console.error("Error resizing image:",a),K((function(e){return o(o([],e,!0),["Failed to process the image. Please try again."],!1)})),[3,4];case 4:return[2]}}))}))},id:"eWorkspace-upload-image-input",ref:F}),G("img",{style:{cursor:"pointer"},onClick:U,src:T||"".concat(e.EWORKSPACE_API_URL_BASE,"/eworkspace/owner/record/").concat(m,"/image?fileKey=").concat(h.mediaContent.data),alt:"STUDENT_ANSWER"===g?"Student Answer Image":"Teacher Feedback Image"})]})]}),G("div",t({class:"eWorkspace-entry-actions"},{children:w&&G(S,{children:[G("button",t({class:"eWorkspace-btn eWorkspace-btn-default",onClick:W},{children:"Cancel"})),G("button",t({class:"eWorkspace-btn eWorkspace-btn-primary",onClick:V,disabled:!(C||M||R||P),style:{backgroundColor:C||M||R||P?Ar:Or,color:C||M||R||P?Tr:Lr}},{children:"Submit"}))]})}))]}))})):G(S,{children:["CALCULATOR"===h.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:["STUDENT_ANSWER"===g&&G("div",t({class:"eWorkspace-entry-inner-actions"},{children:G("div",t({style:{cursor:"pointer",marginRight:"16px"},onClick:H},{children:[G("i",{class:"fas fa-pen"}),G("span",t({class:"inner-action"},{children:"Edit"}))]}))})),G("div",t({class:"eWorkspace-entry-inner-body"},{children:G(gn,{document:h.mediaContent.data,setCalculator:B})}))]})),"CANVAS"===h.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:["STUDENT_ANSWER"===g&&G("div",t({class:"eWorkspace-entry-inner-actions"},{children:G("div",t({style:{cursor:"pointer",marginRight:"16px"},onClick:H},{children:[G("i",{class:"fas fa-pen"}),G("span",t({class:"inner-action"},{children:"Edit"}))]}))})),G("div",t({class:"eWorkspace-entry-inner-body"},{children:G("img",{src:"data:image/svg+xml;base64,".concat(hn(h.mediaContent.canvas)),alt:"STUDENT_ANSWER"===g?"Student Answer Canvas":"Teacher Feedback Canvas"})}))]})),"JSON_PROSEMIRROR"===h.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:["STUDENT_ANSWER"===g&&G("div",t({class:"eWorkspace-entry-inner-actions"},{children:G("div",t({style:{cursor:"pointer",marginRight:"16px"},onClick:H},{children:[G("i",{class:"fas fa-pen"}),G("span",t({class:"inner-action"},{children:"Edit"}))]}))})),G("div",t({class:"eWorkspace-entry-inner-body"},{children:G(tn,{canEdit:!1,setText:E,document:h.mediaContent.doc})}))]})),"PLAIN_TEXT"===h.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:["STUDENT_ANSWER"===g&&G("div",t({class:"eWorkspace-entry-inner-actions"},{children:G("div",t({style:{cursor:"pointer",marginRight:"16px"},onClick:H},{children:[G("i",{class:"fas fa-pen"}),G("span",t({class:"inner-action"},{children:"Edit"}))]}))})),G("div",t({class:"eWorkspace-entry-inner-body"},{children:(null===(s=h.mediaContent.text)||void 0===s?void 0:s.includes('"type": "doc"'))?G(tn,{canEdit:!1,setText:E,document:h.mediaContent.text}):G(tn,{canEdit:!1,setText:E,document:X(h.mediaContent.text)})}))]})),"IMAGE_FILE"===h.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:["STUDENT_ANSWER"===g&&G("div",t({class:"eWorkspace-entry-inner-actions"},{children:G("div",t({style:{cursor:"pointer",marginRight:"16px"},onClick:H},{children:[G("i",{class:"fas fa-pen"}),G("span",t({class:"inner-action"},{children:"Edit"}))]}))})),G("div",t({class:"eWorkspace-entry-inner-body"},{children:G("img",{src:"".concat(e.EWORKSPACE_API_URL_BASE,"/eworkspace/owner/record/").concat(m,"/image?fileKey=").concat(h.mediaContent.data),alt:"STUDENT_ANSWER"===g?"Student Answer Image":"Teacher Feedback Image"})}))]}))]})}))}))]})},Pr=function(n){var r,o=n.comment,i=n.eWorkspace,a=o.createdBy,s=o.content,l=o._id,c=o.createdAt,d=i._id,u="STUDENT"===a.role?"STUDENT_COMMENT":"TEACHER_FEEDBACK",p=Oe(!1),h=p[0],f=p[1],m=Oe("");m[0];var g,y=m[1];return G(S,{children:[G("tr",t({id:"".concat(l),class:"eWorkspace-entry ".concat(u," ").concat(s.contentType),onClick:function(){f((function(e){return!e}))}},{children:[G("td",{children:mn(c)}),G("td",{children:"STUDENT_COMMENT"===u?"Student Comment":"Teacher Feedback"}),G("td",{children:[a.firstName," ",a.lastName]}),G("td",t({id:"eWorkspace-table-chevron"},{children:G("button",t({class:"eWorkspace-icon-button"},{children:G("i",{class:"fas fa-chevron-down","aria-hidden":"true"})}))}))]})),h&&G("tr",t({class:"eWorkspace-entry-content"},{children:G("td",t({colSpan:4},{children:G(S,{children:["CALCULATOR"===s.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:G("div",t({class:"eWorkspace-entry-inner-body"},{children:G(gn,{document:s.mediaContent.data,setCalculator:y})}))})),"CANVAS"===s.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:G("div",t({class:"eWorkspace-entry-inner-body"},{children:G("img",{src:"data:image/svg+xml;base64,".concat(hn(s.mediaContent.canvas)),alt:"STUDENT_COMMENT"===u?"Student Comment Canvas":"Teacher Feedback Canvas"})}))})),"JSON_PROSEMIRROR"===s.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:G("div",t({class:"eWorkspace-entry-inner-body"},{children:G(tn,{canEdit:!1,document:s.mediaContent.doc})}))})),"PLAIN_TEXT"===s.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:G("div",t({class:"eWorkspace-entry-inner-body"},{children:(null===(r=s.mediaContent.text)||void 0===r?void 0:r.includes('"type": "doc"'))?G(tn,{canEdit:!1,document:s.mediaContent.text}):G(tn,{canEdit:!1,document:(g=s.mediaContent.text,'{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"'.concat(g,'"}]}]}'))})}))})),"IMAGE_FILE"===s.contentType&&G("div",t({class:"eWorkspace-entry-inner"},{children:G("div",t({class:"eWorkspace-entry-inner-body"},{children:G("img",{src:"".concat(e.EWORKSPACE_API_URL_BASE,"/eworkspace/owner/record/").concat(d,"/image?fileKey=").concat(s.mediaContent.data),alt:"STUDENT_COMMENT"===u?"Student Comment Image":"Teacher Feedback Image"})}))}))]})}))}))]})};!function(e){e.Submission="submission",e.Comment="comment"}(_r||(_r={}));var Ir=function(){return G("svg",t({width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64","enable-background":"new 0 0 64 64"},{children:G("path",{d:"M32,2C15.431,2,2,15.432,2,32c0,16.568,13.432,30,30,30c16.568,0,30-13.432,30-30C62,15.432,48.568,2,32,2z M25.025,50\nl-0.02-0.02L24.988,50L11,35.6l7.029-7.164l6.977,7.184l21-21.619L53,21.199L25.025,50z",fill:"#0F6C43"})}))},Nr=function(e){var n=e.addSubmission,r=e.submissions,i=e.eWorkspace,a=e.reviewed,s=e.updatedAt,l=i.comments,c=o(o([],r.map((function(e){return t(t({},e),{type:_r.Submission})})),!0),l.map((function(e){return t(t({},e),{type:_r.Comment})})),!0);return G(S,{children:c&&c.length>0&&G("table",t({class:"eWorkspace-entries table"},{children:[G("thead",{children:G("tr",{children:[G("th",t({class:"eWorkspace-table-header",scope:"col"},{children:"Date"})),G("th",t({class:"eWorkspace-table-header",scope:"col"},{children:"Type"})),G("th",t({class:"eWorkspace-table-header",scope:"col"},{children:"Submitted By"})),G("th",{scope:"col"})]})}),G("tbody",{children:[c.sort((function(e,t){var n=new Date(e.createdAt),r=new Date(t.createdAt);return n.getTime()-r.getTime()})).map((function(e){return e.type===_r.Submission?G(Dr,{addSubmission:n,submission:e,eWorkspace:i},e._id):G(Pr,{comment:e,eWorkspace:i},e._id)})),a&&G("tr",t({className:"eWorkspace-entry"},{children:[G("td",{children:mn(s)}),G("td",{children:"Reviewed"}),G("td",{children:"Teacher"}),G("td",t({id:"eWorkspace-table-chevron"},{children:G(Ir,{})}))]}))]})]}))})},Rr=function(e){var i=e.addSubmission,a=e.addEWorkspace,s=e.closeEditor,l=e.eWorkspaceId,c=Be(sn),d=c.curriculumKey,u=c.lesson,p=c.lessonId,h=c.chapter,f=c.problemNumber,m=c.classId,g=Oe(!0),y=g[0],v=g[1],b=Oe(!1),x=b[0],w=b[1],k=Oe(!1),_=k[0],M=k[1],E=Oe(""),z=E[0],C=E[1],L=Oe(void 0),O=L[0],T=L[1],A=Oe(void 0),D=A[0],P=A[1],I=Oe(!1),N=I[0],R=I[1],B=Oe(""),j=B[0],$=B[1],K=Oe(!1),q=K[0],F=K[1],H=Oe(""),W=H[0],V=H[1],U=Oe([]),Z=U[0],X=U[1],Y=Pe(null),J=function(){return n(void 0,void 0,void 0,(function(){var e,t,n,i,a;return r(this,(function(r){switch(r.label){case 0:if(X([]),N?(e="CANVAS",t={version:"1.0",canvas:j}):x?(e="JSON_PROSEMIRROR",t={version:"1.0",doc:z}):q?(e="CALCULATOR",t={data:W}):_&&(e="IMAGE_FILE",t={data:O}),n={context:{curriculumKey:d,chapter:h,lesson:u,lessonId:p,problem:f,classId:m},submission:{content:{contentType:e,mediaContent:t},registryId:"65d5596040f81c148ac92080"},reviewed:!1},"IMAGE_FILE"!==e||!t)return[3,5];(i=new FormData).append("image",t.data),i.append("context",JSON.stringify(n.context)),i.append("submission",JSON.stringify(n.submission)),i.append("reviewed",JSON.stringify(n.reviewed)),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Sr(l,i)];case 2:return a=r.sent(),Q(a),ee(),te(),[3,4];case 3:return r.sent(),X((function(e){return o(o([],e,!0),["We encountered a problem submitting your work. Please try again."],!1)})),[3,4];case 4:return[3,8];case 5:return r.trys.push([5,7,,8]),[4,Sr(l,n)];case 6:return a=r.sent(),Q(a),ee(),te(),[3,8];case 7:return r.sent(),X((function(e){return o(o([],e,!0),["We encountered a problem submitting your work. Please try again."],!1)})),"CANVAS"===e&&(v(!0),R(!1)),[3,8];case 8:return[2]}}))}))},Q=function(e){if(e&&e.submissions){var t=e.submissions[e.submissions.length-1];i?i(t):a?a(e):console.error("Neither addSubmission nor addEWorkspace provided.")}else console.error("Received undefined or malformed submission payload:",e)},ee=function(){v(!0),R(!1),w(!1),F(!1),M(!1),$(""),T(void 0),C(""),V(""),Y&&Y.current&&(Y.current.value=""),X([])},te=function(){s()},ne=function(e){return new Promise((function(t){rn.imageFileResizer(e,1024,786,"JPEG",70,0,(function(e){return t(e)}),"file")}))};return Ae((function(){j&&J()}),[j]),Ae((function(){return O&&P(URL.createObjectURL(O)),function(){D&&(URL.revokeObjectURL(D),P(void 0))}}),[O]),G(S,{children:[Z.length>0&&G("div",t({style:{color:Cr,padding:"10px 15px",border:"1px solid ".concat(Cr),margin:"10px 0",borderRadius:"5px"}},{children:G("ul",t({style:{margin:0,padding:0,listStyleType:"none"}},{children:Z.map((function(e,n){return G("li",t({style:{display:"flex",alignItems:"flex-start",gap:"5px"}},{children:[G("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18",width:"18",height:"18",style:{minWidth:"18px",minHeight:"18px",marginTop:"3px"}},{children:G("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9 2.45455C5.38505 2.45455 2.45455 5.38505 2.45455 9C2.45455 12.615 5.38505 15.5455 9 15.5455C12.615 15.5455 15.5455 12.615 15.5455 9C15.5455 5.38505 12.615 2.45455 9 2.45455ZM1 9C1 4.58172 4.58172 1 9 1C13.4183 1 17 4.58172 17 9C17 13.4183 13.4183 17 9 17C4.58172 17 1 13.4183 1 9ZM9 5.36364C9.40166 5.36364 9.72727 5.68925 9.72727 6.09091V9C9.72727 9.40166 9.40166 9.72727 9 9.72727C8.59834 9.72727 8.27273 9.40166 8.27273 9V6.09091C8.27273 5.68925 8.59834 5.36364 9 5.36364ZM8.27273 11.9091C8.27273 11.5074 8.59834 11.1818 9 11.1818H9.00727C9.40894 11.1818 9.73455 11.5074 9.73455 11.9091C9.73455 12.3108 9.40894 12.6364 9.00727 12.6364H9C8.59834 12.6364 8.27273 12.3108 8.27273 11.9091Z",fill:Cr})})),e]}),n)}))}))})),y&&G("div",t({className:"eWorkspace-editor"},{children:[G("i",{class:"fas fa-times eWorkspace-close-icon",onClick:te}),G("div",t({className:"eWorkspace-selections"},{children:[G("div",t({className:"eWorkspace-selection",onClick:function(){X([]),v(!1),R(!0)}},{children:[G("i",{class:"fas fa-edit eWorkspace-selection-icon"}),"Canvas"]})),G("div",{children:"OR"}),G("div",t({className:"eWorkspace-selection",onClick:function(){X([]),v(!1),w(!0)}},{children:[G("i",{class:"fas fa-keyboard eWorkspace-selection-icon"}),"Text"]})),G("div",{children:"OR"}),G("div",t({className:"eWorkspace-selection",onClick:function(){Y&&Y.current&&Y.current.click(),X([])}},{children:[G("i",{class:"fas fa-file-image eWorkspace-selection-icon"}),"Upload Image",G("input",{type:"file",accept:"image/jpeg, image/png",onInput:function(e){return n(void 0,void 0,void 0,(function(){var t,n,i,a,s;return r(this,(function(r){switch(r.label){case 0:if(!(t=null===(s=e.currentTarget.files)||void 0===s?void 0:s[0]))return[2];if((n=zr(t)).length>0)return X((function(e){return o(o([],e,!0),n,!0)})),T(void 0),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,ne(t)];case 2:return i=r.sent(),T(i),v(!1),M(!0),[3,4];case 3:return a=r.sent(),console.error("Error resizing image:",a),X((function(e){return o(o([],e,!0),["Failed to process the image. Please try again."],!1)})),[3,4];case 4:return[2]}}))}))},id:"eWorkspace-upload-image-input",ref:Y})]})),G("div",{children:"OR"}),G("div",t({className:"eWorkspace-selection",onClick:function(){X([]),v(!1),F(!0)}},{children:[G("i",{class:"fas fa-calculator eWorkspace-selection-icon"}),"Calculator"]}))]}))]})),N&&G(pn,{initialData:"",handleCancel:ee,onExport:function(e){return $(e),e}}),x&&G(S,{children:[G(tn,{setText:C}),G("div",t({class:"eWorkspace-entry-actions"},{children:[G("button",t({class:"eWorkspace-btn eWorkspace-btn-default",onClick:ee},{children:"Cancel"})),G("button",t({class:"eWorkspace-btn eWorkspace-btn-primary",disabled:!z,onClick:J,style:{backgroundColor:z?Ar:Or,color:z?Tr:Lr}},{children:"Submit"}))]}))]}),_&&G(S,{children:[G("img",{class:"eWorkspace-editor-uploaded-image",src:D}),G("div",t({class:"eWorkspace-entry-actions"},{children:[G("button",t({class:"eWorkspace-btn eWorkspace-btn-default",onClick:ee},{children:"Cancel"})),G("button",t({class:"eWorkspace-btn eWorkspace-btn-primary",onClick:J,disabled:!O,style:{backgroundColor:O?Ar:Or,color:O?Tr:Lr}},{children:"Submit"}))]}))]}),q&&G(S,{children:[G(gn,{setCalculator:V}),G("div",t({class:"eWorkspace-entry-actions"},{children:[G("button",t({class:"eWorkspace-btn eWorkspace-btn-default",onClick:ee},{children:"Cancel"})),G("button",t({class:"eWorkspace-btn eWorkspace-btn-primary",onClick:J,disabled:!W,style:{backgroundColor:W?Ar:Or,color:W?Tr:Lr}},{children:"Submit"}))]}))]})]})},Br=function(e){var i=e.eWorkspace,a=e.eWorkspaceId,s=i.submissions,l=i.updatedAt,c=i.reviewed,d=i._id,u=Be(sn),p=u.curriculumKey,h=u.lesson,f=Oe(s||[]),m=f[0],g=f[1],y=Oe(!1),v=y[0],b=y[1],x=Oe(c),w=x[0],k=x[1],_=function(e){return n(void 0,void 0,void 0,(function(){var t;return r(this,(function(i){switch(i.label){case 0:return e?(t=m.findIndex((function(t){return t._id===e._id})),g(-1!==t?function(n){var r=o([],n,!0);return r[t]=e,r}:function(t){return o(o([],t,!0),[e],!1)}),[4,n(void 0,void 0,void 0,(function(){var e,t,n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Mr(p,h)];case 1:return(e=r.sent())&&e.length>0&&(t=e.find((function(e){return e._id===d})))&&k(t.reviewed),[3,3];case 2:return n=r.sent(),console.error("Error refreshing eWorkspace:",n),[3,3];case 3:return[2]}}))}))]):(console.error("Attempted to add undefined submission:",e),[2]);case 1:return i.sent(),[2]}}))}))};return G(S,{children:[G("div",t({class:"eWorkspace-header-with-archive"},{children:G("div",t({class:"eWorkspace-header"},{children:"eWorkspace"}))})),m&&G(Nr,{addSubmission:_,eWorkspace:i,submissions:m,updatedAt:l,reviewed:w}),v?G(Rr,{addSubmission:_,closeEditor:function(){b(!1)},eWorkspaceId:a}):G("div",t({class:"eWorkspace-new"},{children:G("button",t({class:"eWorkspace-btn eWorkspace-btn-primary",onClick:function(){b(!0)}},{children:"New Submission"}))}))]})},jr=function(e){var n=e.eWorkspace,r=e.eWorkspaceId,o=Oe(n),i=o[0],a=o[1],s=Oe(!1),l=s[0],c=s[1];return G("div",t({class:"eWorkspace-container"},{children:i?G(Br,{eWorkspaceId:r,eWorkspace:i}):G(S,l?{children:[G("div",t({class:"eWorkspace-header"},{children:"eWorkspace"})),G(Rr,{addEWorkspace:function(e){a(e),c(!1)},closeEditor:function(){c(!1)},eWorkspaceId:r})]}:{children:[G("div",t({class:"eWorkspace-header-new"},{children:"eWorkspace"})),G("div",t({class:"eWorkspace-new"},{children:G("button",t({class:"eWorkspace-btn eWorkspace-btn-primary",onClick:function(){c(!0)}},{children:"New Submission"}))}))]})}))},$r=window.DESMOS_API_KEY||"dcb31709b452b1cf9dc26972add0fda6";e.TEACHER_BASE=void 0,e.EWORKSPACE_API_URL_BASE=void 0,"ebooks.cpm.org"===window.location.host||"ebooks-mn.cpm.org"===window.location.host?(e.EWORKSPACE_API_URL_BASE="https://cdp-hermes.cpm.org/api",e.TEACHER_BASE="https://ebooks.cpm.org/teacher-admin"):(e.EWORKSPACE_API_URL_BASE="https://cdp-hermes-test.cpm.org/api",e.TEACHER_BASE="https://ebooks-test.cpm.org/teacher-admin"),console.log("eWorkspace: Computed Constants"),console.log("eWorkspace: EWORKSPACE_API_URL_BASE: ".concat(e.EWORKSPACE_API_URL_BASE)),console.log("eWorkspace: TEACHER_BASE: ".concat(e.TEACHER_BASE));var Kr=function(e){return n(void 0,void 0,void 0,(function(){var t,o,i,a,s,l;return r(this,(function(c){switch(c.label){case 0:return[4,n(void 0,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,kr.get("/settings/profile")];case 1:return[2,t.sent().data];case 2:throw e=t.sent(),console.error("Error fetching user profile",e),e;case 3:return[2]}}))}))];case 1:return t=c.sent(),(o=t.curriculum[e])?(i=o.settings.eWorkspaceEnabled,a=t.classes,(s=a.find((function(t){return t.curriculumTitles.includes(e)})))?(l=s.classId,[2,{eWorkspaceEnabled:i,classId:l}]):[2,{eWorkspaceEnabled:i,classId:void 0}]):[2,{eWorkspaceEnabled:!1}]}}))}))};return document.addEventListener("DOMContentLoaded",(function(){return n(void 0,void 0,void 0,(function(){var n,o,i,a,s,l,c,d,u,p,h,f,m,g,y,v,b;return r(this,(function(r){switch(r.label){case 0:return n=pr(),(o=n&&me(n))?(i=document.getElementsByClassName("c3po-metadata")).length?(a=i[0].getAttribute("data-lesson-id"),s=new URLSearchParams(window.location.search),l=s.get("title"),c=s.get("name"),d=c?c.split(".")[0]:"",l&&a&&c?[4,Kr(l)]:[2]):[2]:[2];case 1:return u=r.sent(),p=u.eWorkspaceEnabled,h=u.classId,p?(f=null===(b=o.realm_access)||void 0===b?void 0:b.roles).length?f.includes("FACULTY")?(m=document.getElementById("contents"))?(g=document.createElement("div"),(y=document.createElement("a")).href="".concat(e.TEACHER_BASE,"/lesson/").concat(c),y.target="_blank",y.rel="noreferrer noopener",y.innerText="Teacher Admin",g.appendChild(y),m.prepend(g),[3,4]):[2]:[3,2]:[2]:[3,4];case 2:return f.includes("STUDENT")?((v=document.createElement("script")).src="https://www.desmos.com/api/v1.6/calculator.js?apiKey=".concat($r),document.body.appendChild(v),[4,Mr(l,c)]):[3,4];case 3:(function(e,n,r,o,i,a){var s=document.getElementsByClassName("contentContainerReference problem");s.length&&Array.from(s).forEach((function(s){var l,c=s.getAttribute("container-id"),d=s.getAttribute("id");if(c&&d){var u=e.find((function(e){return e.eWorkspaceId===c}))||null,p=s.id,h=s.innerHTML,f=document.createElement("div"),m="eWorkspace-container-".concat(p);f.setAttribute("id",m),null===(l=document.getElementById(p))||void 0===l||l.appendChild(f),F(G(sn.Provider,t({value:{curriculumKey:n,chapter:i,lesson:r,lessonId:o,problem:h,problemNumber:d,classId:a}},{children:G(jr,{eWorkspace:u,eWorkspaceId:c})})),document.getElementById(m))}}))})(r.sent(),l,c,a,d,h),r.label=4;case 4:return[2]}}))}))})),e.isEWorkspaceEnabledAndGetClassId=Kr,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); //# sourceMappingURL=eworkspace-plugin.js.map